本文整理汇总了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;
}
示例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);
}
}
示例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));
}
}
示例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));
}
}