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


C# MapNode.CopyFormatTo方法代码示例

本文整理汇总了C#中MindMate.Model.MapNode.CopyFormatTo方法的典型用法代码示例。如果您正苦于以下问题:C# MapNode.CopyFormatTo方法的具体用法?C# MapNode.CopyFormatTo怎么用?C# MapNode.CopyFormatTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MindMate.Model.MapNode的用法示例。


在下文中一共展示了MapNode.CopyFormatTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CopyFormatTo_ValidateObjectState

        public void CopyFormatTo_ValidateObjectState()
        {
            var t = new MapTree();
            var r = new MapNode(t, "Root");

            var n1 = new MapNode(r, "Testing Format Copy");
            var n2 = new MapNode(r, "Testing Format Copy");

            n1.Bold = true;
            n1.Strikeout = true;
            n1.Color = Color.BlueViolet;
            n1.BackColor = Color.Bisque;
            n1.FontSize = 16;

            n1.CopyFormatTo(n2);

            Assert.AreEqual(n1.Bold, n2.Bold);
            Assert.AreEqual(n1.Strikeout, n2.Strikeout);
            Assert.AreEqual(n1.Italic, n2.Italic);
            Assert.AreEqual(n1.Color, n2.Color);
            Assert.AreEqual(n1.BackColor, n2.BackColor);
            Assert.AreEqual(n1.FontSize, n2.FontSize);
            Assert.AreEqual(n1.FontName, n2.FontName);
        }
开发者ID:,项目名称:,代码行数:24,代码来源:

示例2: CopyFormatTo_CompareOutputWithSavedImage

        public void CopyFormatTo_CompareOutputWithSavedImage()
        {
            var t = new MapTree();
            var r = new MapNode(t, "Root");

            var n1 = new MapNode(r, "Testing Format Copy");
            var n2 = new MapNode(r, "Testing Format Copy");

            n1.Bold = true;
            n1.Strikeout = true;
            n1.Color = Color.BlueViolet;
            n1.BackColor = Color.Bisque;
            n1.FontSize = 16;

            n1.CopyFormatTo(n2);

            MetaModel.MetaModel.Initialize();
            var mapView = new MapView(t);
            mapView.GetNodeView(n1);
            mapView.GetNodeView(n2);

            Bitmap bmp1 = new Bitmap(@"Resources\CopyFormatTo_CompareOutputWithSavedImage_Src.png");

            Bitmap bmp2 = new Bitmap(2500, 2500);
            Graphics g = Graphics.FromImage(bmp2);
            MapPainter.DrawNode(n2, false, mapView, g);
            g.Dispose();

            bmp2.Save(@"Resources\CopyFormatTo_CompareOutputWithSavedImage_Des.png", ImageFormat.Png);

            Assert.IsTrue(bmp1.PercentageDifference(bmp2, 0) == 0);

            bmp1.Dispose();
            bmp2.Dispose();
        }
开发者ID:,项目名称:,代码行数:35,代码来源:


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