当前位置: 首页>>代码示例>>C#>>正文


C# TextBuffer.CreateMark方法代码示例

本文整理汇总了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");
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:20,代码来源:ChessGameView.cs

示例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++;
                }
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:62,代码来源:ChessGameView.cs


注:本文中的TextBuffer.CreateMark方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。