ICSharpCode.TextEditor.TextArea.EndUpdate C# (CSharp) Method

EndUpdate() public method

public EndUpdate ( ) : void
return void
		public void EndUpdate()
		{
			motherTextEditorControl.EndUpdate();
		}
		

Usage Example

 public void Cut(object sender, EventArgs e)
 {
     if (CopyTextToClipboard(textArea.SelectionManager.SelectedText))
     {
         // Remove text
         textArea.BeginUpdate();
         textArea.Caret.Position = textArea.SelectionManager.SelectionCollection[0].StartPosition;
         textArea.SelectionManager.RemoveSelectedText();
         textArea.EndUpdate();
     }
     else
     {
         // No text was selected, select and cut the entire line
         int         curLineNr        = textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset);
         LineSegment lineWhereCaretIs = textArea.Document.GetLineSegment(curLineNr);
         string      caretLineText    = textArea.Document.GetText(lineWhereCaretIs.Offset, lineWhereCaretIs.TotalLength);
         textArea.SelectionManager.SetSelection(textArea.Document.OffsetToPosition(lineWhereCaretIs.Offset), textArea.Document.OffsetToPosition(lineWhereCaretIs.Offset + lineWhereCaretIs.TotalLength));
         if (CopyTextToClipboard(caretLineText))
         {
             // remove line
             textArea.BeginUpdate();
             textArea.Caret.Position = textArea.Document.OffsetToPosition(lineWhereCaretIs.Offset);
             textArea.SelectionManager.RemoveSelectedText();
             textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.PositionToEnd, new Point(0, curLineNr)));
             textArea.EndUpdate();
         }
     }
 }
All Usage Examples Of ICSharpCode.TextEditor.TextArea::EndUpdate