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

ExtendSelectionTo() public method

public ExtendSelectionTo ( int offset ) : void
offset int
return void
		public void ExtendSelectionTo (int offset)
		{
			ExtendSelectionTo (document.OffsetToLocation (offset));
		}
		

Same methods

TextEditorData::ExtendSelectionTo ( Mono.TextEditor.DocumentLocation location ) : void

Usage Example

コード例 #1
0
        public static void EndLineSelection(TextEditorData data)
        {
            int fromLine  = data.MainSelection.Anchor.Line;
            int toLine    = data.Caret.Line;
            var toSegment = data.Document.GetLine(toLine);

            //flip the anchor if pivoting around the origin line
            if (fromLine == toLine + 1)
            {
                if ((fromLine - data.MainSelection.Lead.Line) != 2)
                {
                    var fromSegment = data.Document.GetLine(fromLine);
                    data.SetSelection(fromSegment.EndOffsetIncludingDelimiter, toSegment.Offset);
                }
                else
                {
                    data.SetSelection(toSegment.Offset, toSegment.EndOffsetIncludingDelimiter);
                }
            }
            //else just extend the selection else
            {
                int toOffset = (toLine < fromLine) ? toSegment.Offset : toSegment.EndOffsetIncludingDelimiter;
                data.ExtendSelectionTo(toOffset);
            }
            data.Caret.PreserveSelection = false;
        }
All Usage Examples Of Mono.TextEditor.TextEditorData::ExtendSelectionTo