本文整理汇总了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);
}
示例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();
}