Mono.TextEditor.TextEditorData.GetTextAt C# (CSharp) Method

GetTextAt() public method

public GetTextAt ( DocumentRegion region ) : string
region DocumentRegion
return string
		public string GetTextAt (DocumentRegion region)
		{
			return document.GetTextAt (region);
		}

Same methods

TextEditorData::GetTextAt ( TextSegment segment ) : string
TextEditorData::GetTextAt ( int offset, int count ) : string

Usage Example

Example #1
0
 public static void DuplicateLine(TextEditorData data)
 {
     using (var undoGroup = data.OpenUndoGroup()) {
         if (data.IsSomethingSelected)
         {
             var selectedText = data.SelectedText;
             data.ClearSelection();
             data.InsertAtCaret(selectedText);
         }
         else
         {
             DocumentLine line = data.Document.GetLine(data.Caret.Line);
             if (line == null)
             {
                 return;
             }
             if (line.DelimiterLength == 0)
             {
                 data.Insert(line.Offset, data.GetTextAt(line.SegmentIncludingDelimiter) + data.EolMarker);
             }
             else
             {
                 data.Insert(line.Offset, data.GetTextAt(line.SegmentIncludingDelimiter));
             }
         }
     }
 }
All Usage Examples Of Mono.TextEditor.TextEditorData::GetTextAt