本文整理汇总了C#中Gtk.ForwardChars方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.ForwardChars方法的具体用法?C# Gtk.ForwardChars怎么用?C# Gtk.ForwardChars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk
的用法示例。
在下文中一共展示了Gtk.ForwardChars方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyCJKToBlock
void ApplyCJKToBlock(Gtk.TextIter start, Gtk.TextIter end)
{
NoteBuffer.GetBlockExtents (ref start,
ref end,
512 /* XXX */,
cjk_tag);
Buffer.RemoveTag (cjk_tag, start, end);
MatchCJK m = new MatchCJK (start.GetText (end));
foreach (MatchCJK.CJKGroup g in m) {
Gtk.TextIter start_cpy = start;
start_cpy.ForwardChars (g.Start);
end = start;
end.ForwardChars (g.End);
Buffer.ApplyTag (cjk_tag, start_cpy, end);
}
}
示例2: ApplyEALToBlock
void ApplyEALToBlock(Gtk.TextIter start, Gtk.TextIter end)
{
AddLanguageTag ();
NoteBuffer.GetBlockExtents (ref start,
ref end,
512 /* XXX */,
eal_tag);
Buffer.RemoveTag (eal_tag, start, end);
MatchEAL m = new MatchEAL (start.GetText (end));
foreach (MatchEAL.EALGroup g in m) {
Gtk.TextIter start_cpy = start;
start_cpy.ForwardChars (g.Start);
end = start;
end.ForwardChars (g.End);
Buffer.ApplyTag (eal_tag, start_cpy, end);
}
}
示例3: IncreaseDepth
public void IncreaseDepth (ref Gtk.TextIter start)
{
if (!CanMakeBulletedList())
return;
Gtk.TextIter end;
start = GetIterAtLineOffset (start.Line, 0);
Gtk.TextIter line_end = GetIterAtLine (start.Line);
line_end.ForwardToLineEnd ();
end = start;
end.ForwardChars (2);
DepthNoteTag curr_depth = FindDepthTag (start);
Undoer.FreezeUndo ();
if (curr_depth == null) {
// Insert a brand new bullet
Gtk.TextIter next = start;
next.ForwardSentenceEnd ();
next.BackwardSentenceStart ();
// Insert the bullet using the same direction
// as the text on the line
Pango.Direction direction = Pango.Direction.Ltr;
if (next.Char.Length > 0 && next.Line == start.Line)
direction = Pango.Global.UnicharDirection (next.Char[0]);
InsertBullet (ref start, 0, direction);
} else {
// Remove the previous indent
Delete (ref start, ref end);
// Insert the indent at the new depth
int nextDepth = curr_depth.Depth + 1;
InsertBullet (ref start, nextDepth, curr_depth.Direction);
}
Undoer.ThawUndo ();
ChangeTextDepth (this, new ChangeDepthEventArgs (start.Line, true));
}
示例4: ApplyWikiwordToBlock
void ApplyWikiwordToBlock (Gtk.TextIter start, Gtk.TextIter end)
{
NoteBuffer.GetBlockExtents (ref start,
ref end,
80 /* max wiki name */,
broken_link_tag);
Buffer.RemoveTag (broken_link_tag, start, end);
for (Match match = regex.Match (start.GetText (end));
match.Success;
match = match.NextMatch ()) {
System.Text.RegularExpressions.Group group = match.Groups [1];
Gtk.TextIter start_cpy = start;
start_cpy.ForwardChars (group.Index);
end = start_cpy;
end.ForwardChars (group.Length);
if (Note.TagTable.HasLinkTag (start_cpy))
break;
Logger.Debug ("Highlighting wikiword: '{0}' at offset {1}",
group,
group.Index);
if (Manager.Find (group.ToString ()) == null) {
Buffer.ApplyTag (broken_link_tag, start_cpy, end);
}
}
}
示例5: ApplyUrlToBlock
void ApplyUrlToBlock (Gtk.TextIter start, Gtk.TextIter end)
{
NoteBuffer.GetBlockExtents (ref start,
ref end,
256 /* max url length */,
Note.TagTable.UrlTag);
Buffer.RemoveTag (Note.TagTable.UrlTag, start, end);
for (Match match = regex.Match (start.GetSlice (end));
match.Success;
match = match.NextMatch ()) {
System.Text.RegularExpressions.Group group = match.Groups [1];
/*
Logger.Log ("Highlighting url: '{0}' at offset {1}",
group,
group.Index);
*/
Gtk.TextIter start_cpy = start;
start_cpy.ForwardChars (group.Index);
end = start_cpy;
end.ForwardChars (group.Length);
Buffer.ApplyTag (Note.TagTable.UrlTag, start_cpy, end);
}
}