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

OffsetToLocation() public method

public OffsetToLocation ( int offset ) : Mono.TextEditor.DocumentLocation
offset int
return Mono.TextEditor.DocumentLocation
		public DocumentLocation OffsetToLocation (int offset)
		{
			return Document.OffsetToLocation (offset);
		}

Usage Example

            public void CopyData(TextEditorData data)
            {
                Selection selection;

                isLineSelectionMode = !data.IsSomethingSelected;
                if (data.IsSomethingSelected)
                {
                    selection = data.MainSelection;
                }
                else
                {
                    var start = DeleteActions.GetStartOfLineOffset(data, data.Caret.Location);
                    var end   = DeleteActions.GetEndOfLineOffset(data, data.Caret.Location, false);
                    selection = new Selection(data.OffsetToLocation(start), data.OffsetToLocation(end));
                }
                CopyData(data, selection);

                if (Copy != null)
                {
                    Copy(copiedDocument != null ? copiedDocument.Text : null);
                }
            }
All Usage Examples Of Mono.TextEditor.TextEditorData::OffsetToLocation