本文整理汇总了C#中Link.GetVertices方法的典型用法代码示例。如果您正苦于以下问题:C# Link.GetVertices方法的具体用法?C# Link.GetVertices怎么用?C# Link.GetVertices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Link
的用法示例。
在下文中一共展示了Link.GetVertices方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLinkPoints90Degrees
public void GetLinkPoints90Degrees()
{
Point centerA = new Point(10, 10);
Point centerB = new Point(30, 10);
int radius = 5;
NetworkNode nodeA = new NetworkNode("A", radius, centerA, Color.Red, Color.Navy);
NetworkNode nodeB = new NetworkNode("B", radius, centerB, Color.Blue, Color.Navy);
int width = 6;
Link link = new Link(width, nodeA, nodeB, Color.Green, Color.Navy);
Point[] allPoints = link.GetVertices();
Point[] expectedPoints = new Point[] { new Point(14, 13), new Point(26, 13), new Point(14, 7), new Point(26, 7) };
for (int i = 0; i < 4; i++)
{
Point point = allPoints[i];
Point expectedPoint = expectedPoints[i];
Assert.IsTrue(PointsAreEqual(point, expectedPoint));
}
}