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


C# TextEditorData.GetIndentationString方法代碼示例

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


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

示例1: GetVisualColumn

		public int GetVisualColumn (TextEditorData editor, int logicalColumn)
		{
			int result = 1;
			int offset = Offset;
			if (editor.Options.IndentStyle == IndentStyle.Virtual && Length == 0 && logicalColumn > DocumentLocation.MinColumn) {
				foreach (char ch in editor.GetIndentationString (Offset)) {
					if (ch == '\t') {
						result += editor.Options.TabSize;
						continue;
					}
					result++;
				}
				return result;
			}
			for (int i = 0; i < logicalColumn - 1; i++) {
				if (i < Length && editor.Document.GetCharAt (offset + i) == '\t') {
					result = TextViewMargin.GetNextTabstop (editor, result);
				} else {
					result++;
				}
			}
			return result;
		}
開發者ID:txdv,項目名稱:monodevelop,代碼行數:23,代碼來源:LineSegment.cs

示例2: NewLineSmartIndent

		static void NewLineSmartIndent (TextEditorData data)
		{
			using (var undo = data.OpenUndoGroup ()) {
				data.EnsureCaretIsNotVirtual ();
				string indentString;
				if (data.HasIndentationTracker) {
					indentString = data.IndentationTracker.GetIndentationString (data.Caret.Location);
				} else {
					indentString = data.GetIndentationString (data.Caret.Location);
				}
				data.InsertAtCaret (data.EolMarker);
				data.InsertAtCaret (indentString);
			}
		}
開發者ID:FreeBSD-DotNet,項目名稱:monodevelop,代碼行數:14,代碼來源:MiscActions.cs

示例3: NewLineSmartIndent

		static void NewLineSmartIndent (TextEditorData data)
		{
			using (var undo = data.OpenUndoGroup ()) {
				data.EnsureCaretIsNotVirtual ();
				data.InsertAtCaret (data.EolMarker);
				data.InsertAtCaret (data.GetIndentationString (data.Caret.Location));
			}
		}
開發者ID:OnorioCatenacci,項目名稱:monodevelop,代碼行數:8,代碼來源:MiscActions.cs

示例4: NewLineSmartIndent

		static void NewLineSmartIndent (TextEditorData data)
		{
			using (var undo = data.OpenUndoGroup ()) {
				data.EnsureCaretIsNotVirtual ();
				data.InsertAtCaret (data.EolMarker);
				var line = data.Document.GetLine (data.Caret.Line);
				data.InsertAtCaret (data.GetIndentationString (line.EndOffset));
			}
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:9,代碼來源:MiscActions.cs


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