ExtendSelectionTo() 공개 메소드

public ExtendSelectionTo ( Mono.TextEditor.DocumentLocation location ) : void
location Mono.TextEditor.DocumentLocation
리턴 void
        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;
        }
 public static void EndSelection(TextEditorData data)
 {
     data.ExtendSelectionTo(data.Caret.Location);
     data.Caret.AutoScrollToCaret = true;
     data.Caret.PreserveSelection = false;
 }
 public void DataCaretPositionChanged(object sender, DocumentLocationEventArgs e)
 {
     data.ExtendSelectionTo(data.Caret.Location);
 }
예제 #4
0
		public static void EndSelection (TextEditorData data)
		{
			data.ExtendSelectionTo (data.Caret.Location);
			data.Caret.AutoScrollToCaret = true;
			data.Caret.PreserveSelection = false;
		}
예제 #5
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.EndOffset, toSegment.Offset);
				} else {
					data.SetSelection (toSegment.Offset, toSegment.EndOffset);
				}
			}
			//else just extend the selection
			else {
				int toOffset = (toLine < fromLine)? toSegment.Offset: toSegment.EndOffset;
				data.ExtendSelectionTo (toOffset);
			}
			data.Caret.PreserveSelection = false;
		}
		public static void EndLineSelection (TextEditorData data)
		{
			int fromLine = data.MainSelection.Anchor.Line,
			    toLine = data.Caret.Line;
			LineSegment toSegment = data.Document.GetLine (toLine);
			int toOffset = (toLine < fromLine)? toSegment.Offset: toSegment.EndOffset;
			
			data.ExtendSelectionTo (toOffset);
			data.Caret.PreserveSelection = false;
		}