コード例 #1
0
		public void ExtendSelectionTo (long offset)
		{
			offset = System.Math.Min (Length, System.Math.Max (0, offset));
			if (MainSelection == null) 
				MainSelection = new Selection (offset, offset);
			MainSelection.Lead = offset;
		}
コード例 #2
0
		public void SetSelection (long anchor, long lead)
		{
			anchor = System.Math.Min (Length, System.Math.Max (0, anchor));
			lead = System.Math.Min (Length, System.Math.Max (0, lead));
			MainSelection = new Selection (anchor, lead);
		}
コード例 #3
0
		public void DeleteSelection ()
		{
			if (!this.IsSomethingSelected)
				return;
			long start = MainSelection.Segment.Offset;
			switch (MainSelection.SelectionMode) {
			case SelectionMode.Normal:
				Remove (MainSelection.Segment);
				break;
			case SelectionMode.Block:
				throw new NotImplementedException ();
			}
			
			MainSelection = null;
			Caret.Offset = start;
			OnSelectionChanged (EventArgs.Empty);
			
		}
コード例 #4
0
		public void ClearSelection ()
		{
			if (!this.IsSomethingSelected)
				return;
			MainSelection = null;
			OnSelectionChanged (EventArgs.Empty);
		}