本文整理汇总了C#中Gtk.GetIterAtLine方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.GetIterAtLine方法的具体用法?C# Gtk.GetIterAtLine怎么用?C# Gtk.GetIterAtLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk
的用法示例。
在下文中一共展示了Gtk.GetIterAtLine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Undo
public void Undo (Gtk.TextBuffer buffer)
{
Gtk.TextIter iter = buffer.GetIterAtOffset (offset);
iter.ForwardLine ();
iter = buffer.GetIterAtLine (iter.Line);
((NoteBuffer) buffer).RemoveBullet (ref iter);
iter.ForwardToLineEnd ();
buffer.MoveMark (buffer.InsertMark, iter);
buffer.MoveMark (buffer.SelectionBound, iter);
}
示例2: Serialize
//.........这里部分代码省略.........
while (continue_stack.Count > 0 &&
((depth_tag == null && iter.StartsLine ()) || iter.LineOffset == 1))
{
Gtk.TextTag continue_tag = continue_stack.Pop();
if (!TagEndsHere (continue_tag, iter, next_iter)
&& iter.HasTag (continue_tag))
{
WriteTag (continue_tag, xml, true);
tag_stack.Push (continue_tag);
}
}
// Hidden character representing an anchor
if (iter.Char[0] == (char) 0xFFFC) {
Logger.Info ("Got child anchor!");
if (iter.ChildAnchor != null) {
string serialize =
(string) iter.ChildAnchor.Data ["serialize"];
if (serialize != null)
xml.WriteRaw (serialize);
}
// Line Separator character
} else if (iter.Char == "\u2028") {
xml.WriteCharEntity ('\u2028');
} else if (depth_tag == null) {
xml.WriteString (iter.Char);
}
bool end_of_depth_line = line_has_depth && next_iter.EndsLine ();
bool next_line_has_depth = false;
if (iter.Line < buffer.LineCount - 1) {
Gtk.TextIter next_line = buffer.GetIterAtLine(iter.Line+1);
next_line_has_depth =
((NoteBuffer)buffer).FindDepthTag (next_line) != null;
}
bool at_empty_line = iter.EndsLine () && iter.StartsLine ();
if (end_of_depth_line ||
(next_line_has_depth && (next_iter.EndsLine () || at_empty_line)))
{
// Close all tags in the tag_stack
while (tag_stack.Count > 0) {
Gtk.TextTag existing_tag = tag_stack.Pop ();
// Any tags which continue across the indented
// line are added to the continue_stack to be
// reopened at the start of the next <list-item>
if (!TagEndsHere (existing_tag, iter, next_iter)) {
continue_stack.Push (existing_tag);
}
WriteTag (existing_tag, xml, false);
}
} else {
foreach (Gtk.TextTag tag in iter.Tags) {
if (TagEndsHere (tag, iter, next_iter) &&
NoteTagTable.TagIsSerializable(tag) && !(tag is DepthNoteTag))
{
while (tag_stack.Count > 0) {
Gtk.TextTag existing_tag = tag_stack.Pop ();
if (!TagEndsHere (existing_tag, iter, next_iter)) {
replay_stack.Push (existing_tag);
示例3: Redo
public void Redo (Gtk.TextBuffer buffer)
{
Gtk.TextIter iter = buffer.GetIterAtLine (line);
if (direction) {
((NoteBuffer) buffer).IncreaseDepth (ref iter);
} else {
((NoteBuffer) buffer).DecreaseDepth (ref iter);
}
buffer.MoveMark (buffer.InsertMark, iter);
buffer.MoveMark (buffer.SelectionBound, iter);
}