ICSharpCode.TextEditor.Caret.UpdateCaretPosition C# (CSharp) Метод

UpdateCaretPosition() публичный Метод

public UpdateCaretPosition ( ) : void
Результат void
		public void UpdateCaretPosition()
		{
			Log("UpdateCaretPosition");
			
			if (textArea.TextEditorProperties.CaretLine) {
				textArea.Invalidate();
			} else {
				if (caretImplementation.RequireRedrawOnPositionChange) {
					textArea.UpdateLine(oldLine);
					if (line != oldLine)
						textArea.UpdateLine(line);
				} else {
					if (textArea.MotherTextAreaControl.TextEditorProperties.LineViewerStyle == LineViewerStyle.FullRow && oldLine != line) {
						textArea.UpdateLine(oldLine);
						textArea.UpdateLine(line);
					}
				}
			}
			oldLine = line;
			
			
			if (hidden || textArea.MotherTextEditorControl.IsInUpdate) {
				outstandingUpdate = true;
				return;
			} else {
				outstandingUpdate = false;
			}
			ValidateCaretPos();
			int lineNr = this.line;
			int xpos = textArea.TextView.GetDrawingXPos(lineNr, this.column);
			//LineSegment lineSegment = textArea.Document.GetLineSegment(lineNr);
			Point pos = ScreenPosition;
			if (xpos >= 0) {
				CreateCaret();
				bool success = caretImplementation.SetPosition(pos.X, pos.Y);
				if (!success) {
					caretImplementation.Destroy();
					caretCreated = false;
					UpdateCaretPosition();
				}
			} else {
				caretImplementation.Destroy();
			}
			
			// set the input method editor location
			if (ime == null) {
				ime = new Ime(textArea.Handle, textArea.Document.TextEditorProperties.Font);
			} else {
				ime.HWnd = textArea.Handle;
				ime.Font = textArea.Document.TextEditorProperties.Font;
			}
			ime.SetIMEWindowLocation(pos.X, pos.Y);
			
			currentPos = pos;
		}

Usage Example

Пример #1
0
 public void OptionsChanged()
 {
     UpdateMatchingBracket();
     TextView.OptionsChanged();
     Caret.RecreateCaret();
     Caret.UpdateCaretPosition();
     Refresh();
 }
All Usage Examples Of ICSharpCode.TextEditor.Caret::UpdateCaretPosition