當前位置: 首頁>>代碼示例>>C#>>正文


C# TextEditorData.ExtendSelectionTo方法代碼示例

本文整理匯總了C#中Mono.TextEditor.TextEditorData.ExtendSelectionTo方法的典型用法代碼示例。如果您正苦於以下問題:C# TextEditorData.ExtendSelectionTo方法的具體用法?C# TextEditorData.ExtendSelectionTo怎麽用?C# TextEditorData.ExtendSelectionTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mono.TextEditor.TextEditorData的用法示例。


在下文中一共展示了TextEditorData.ExtendSelectionTo方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: EndLineSelection

		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;
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:22,代碼來源:SelectionActions.cs

示例2: EndSelection

		public static void EndSelection (TextEditorData data)
		{
			data.ExtendSelectionTo (data.Caret.Location);
			data.Caret.AutoScrollToCaret = true;
			data.Caret.PreserveSelection = false;
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:6,代碼來源:SelectionActions.cs

示例3: EndLineSelection

		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;
		}
開發者ID:transformersprimeabcxyz,項目名稱:monodevelop-1,代碼行數:10,代碼來源:SelectionActions.cs


注:本文中的Mono.TextEditor.TextEditorData.ExtendSelectionTo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。