本文整理汇总了C#中Gtk.TextBuffer.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# TextBuffer.Delete方法的具体用法?C# TextBuffer.Delete怎么用?C# TextBuffer.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TextBuffer
的用法示例。
在下文中一共展示了TextBuffer.Delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Undo
public override void Undo (TextBuffer buffer)
{
#if DEBUG
Console.WriteLine ("DEBUG: Chop Text: {0} Length: {1}", chop.Text, chop.Length);
#endif
TextIter startIter = buffer.GetIterAtOffset (index);
TextIter endIter = buffer.GetIterAtOffset (index + chop.Length);
buffer.Delete (ref startIter, ref endIter);
buffer.MoveMark (buffer.InsertMark, buffer.GetIterAtOffset (index));
buffer.MoveMark (buffer.SelectionBound, buffer.GetIterAtOffset (index));
}
示例2: Redo
public override void Redo (TextBuffer buffer)
{
TextIter startIter = buffer.GetIterAtOffset (start);
TextIter endIter = buffer.GetIterAtOffset (end);
buffer.Delete (ref startIter, ref endIter);
buffer.MoveMark (buffer.InsertMark, buffer.GetIterAtOffset (start));
buffer.MoveMark (buffer.SelectionBound, buffer.GetIterAtOffset (start));
}
示例3: TruncateConsole
void TruncateConsole(TextBuffer buf, int toLength)
{
int pre = buf.CharCount;
TextIter startIter = buf.StartIter;
TextIter endIter = buf.StartIter;
endIter.ForwardChars(buf.CharCount - toLength);
buf.Delete(ref startIter, ref endIter);
Console.WriteLine("Truncated console. Pre-trunc: {0} Post-trunc: {1}",
pre, buf.CharCount);
}