本文整理汇总了C#中IEditor.DeleteText方法的典型用法代码示例。如果您正苦于以下问题:C# IEditor.DeleteText方法的具体用法?C# IEditor.DeleteText怎么用?C# IEditor.DeleteText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEditor
的用法示例。
在下文中一共展示了IEditor.DeleteText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
//.........这里部分代码省略.........
{
if (match.Index >= iColumn)
break;
newX = match.Index;
}
}
// :: new position is not found in the line
if (newX < 0)
{
if (alt || line != null)
return;
if (right)
{
if (++iLine >= editor.Count)
return;
iColumn = -1;
}
else
{
if (--iLine < 0)
return;
iColumn = int.MaxValue;
}
continue;
}
if (operation == Operation.Step)
{
// :: step
if (line == null)
{
editor.GoTo(newX, iLine);
editor.UnselectText();
editor.Redraw();
}
else
{
//_100819_142053 Mantis#1464 Here was a kludge
line.UnselectText();
line.Caret = newX;
}
}
else if (operation == Operation.Select)
{
// :: select
if (alt)
SelectColumn(editor, right, iLine, caret.X, newX);
else
SelectStream(editor, line, right, caret, new Point(newX, iLine));
}
else
{
// :: delete
if (line == null)
{
if (!right && newX == 0 && caret.X > 0 && currentLine.Length == 0)
{
// "Cursor beyond end of line" and the line is empty
editor.UnselectText();
editor.GoToColumn(0);
}
else
{
// select the step text and delete it
if (!editor.SelectionExists)
{
if (right)
editor.SelectText(caret.X, caret.Y, newX - 1, iLine);
else
editor.SelectText(newX, iLine, caret.X - 1, caret.Y);
}
editor.DeleteText();
}
editor.Redraw();
}
else
{
if (line.SelectionSpan.Length <= 0)
{
if (right)
line.SelectText(caret.X, newX);
else
line.SelectText(newX, caret.X);
}
newX = line.SelectionSpan.Start;
line.SelectedText = string.Empty;
line.Caret = newX;
}
}
return;
}
}