public LocationToOffset ( Mono.TextEditor.DocumentLocation location ) : int | ||
location | Mono.TextEditor.DocumentLocation | |
return | int |
// Assuming a TextEditorData instance called 'editor' int offset = editor.LocationToOffset(2, 3); // Converts line 2, column 3 to an offset value
// Assuming a TextEditorData instance called 'editor' int offset = editor.LocationToOffset(editor.Caret.Line, editor.Caret.Column); // Converts the current caret position to an offset valueThis code snippet converts the current caret location to an offset within the editor's text. The Mono.TextEditor.TextEditorData class is part of the MonoDevelop package library.
public LocationToOffset ( Mono.TextEditor.DocumentLocation location ) : int | ||
location | Mono.TextEditor.DocumentLocation | |
return | int |