本文整理汇总了C#中TextBuffer.CreateMark方法的典型用法代码示例。如果您正苦于以下问题:C# TextBuffer.CreateMark方法的具体用法?C# TextBuffer.CreateMark怎么用?C# TextBuffer.CreateMark使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextBuffer
的用法示例。
在下文中一共展示了TextBuffer.CreateMark方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrintTitle
private void PrintTitle(TextBuffer buffer,
ref TextIter iter)
{
if (game == null)
return;
string title = String.Format ("{0} vs {1}",
game.White,
game.Black);
buffer.CreateMark ("-1", iter, true);
buffer.InsertWithTagsByName (ref iter, title,
HEADING_TAG);
buffer.Insert (ref iter, "\n");
Widget tagdetails = GetTagDetailsWidget ();
TextChildAnchor anchor =
buffer.CreateChildAnchor (ref iter);
view.AddChildAtAnchor (tagdetails, anchor);
buffer.Insert (ref iter, "\n\n");
}
示例2: UpdateGameDetails
private void UpdateGameDetails(TextBuffer buffer,
ref TextIter iter)
{
PrintTitle (buffer, ref iter);
if (game == null)
return;
if (game.Comment != null)
{
buffer.InsertWithTags (ref
iter,
game.Comment,
commentTag);
buffer.Insert (ref iter, "\n");
}
int i = 0;
int moveno = 1;
foreach (PGNChessMove move in game.Moves)
{
if (i % 2 == 0)
{
buffer.InsertWithTags (ref
iter,
moveno.
ToString
(),
movenumberTag);
moveno++;
buffer.Insert (ref iter,
". ");
}
string markstr = i.ToString ();
string text = move.DetailedMove;
buffer.CreateMark (markstr, iter, true); // left gravity
TextTag link_tag = new TextTag (null);
tag_links[link_tag] = i;
taglinks.Add (link_tag);
buffer.TagTable.Add (link_tag);
buffer.InsertWithTags (ref iter, text,
moveTag,
link_tag);
marks[markstr] = text.Length;
buffer.Insert (ref iter, " ");
if (move.comment != null)
{
buffer.Insert (ref iter,
"\n");
buffer.InsertWithTags (ref
iter,
FormatComment
(move.
comment),
commentTag);
buffer.Insert (ref iter,
"\n");
}
i++;
}
}