本文整理汇总了C#中IFactory.CreateLink方法的典型用法代码示例。如果您正苦于以下问题:C# IFactory.CreateLink方法的具体用法?C# IFactory.CreateLink怎么用?C# IFactory.CreateLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFactory
的用法示例。
在下文中一共展示了IFactory.CreateLink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetInLinks
private LinkCollection GetInLinks(IFactory factory)
{
LinkCollection links = new LinkCollection();
ChartObjectCollection nodes = new ChartObjectCollection();
nodes.Add(_node);
// Collect all objects within that group
if (_keepGroups)
{
int i = 0;
while (i < nodes.Count)
{
Node node = nodes[i] as Node;
i++;
if (node.SubordinateGroup != null)
{
foreach (ChartObject sub in node.SubordinateGroup.AttachedObjects)
{
// Check if attached object is a node
if (!(sub is Node))
continue;
// Add the node to the nodes of the group
if (!nodes.Contains(sub))
nodes.Add(sub);
}
}
}
}
foreach (Node node in nodes)
{
foreach (Arrow a in node.IncomingArrows)
{
// Ignore non-layoutable objects
if (a.IgnoreLayout)
continue;
if (a.Origin.Frozen)
continue;
if (!a.IsConnected)
continue;
// Add only if it comes from outside the group
if (!nodes.Contains(a.Origin))
{
// Use the factory to create the adapter link.
// That way, if the adapter for the arrow already
// exists, it will be returned instead of creating a
// new adapter.
links.Add(factory.CreateLink(a,
_keepGroups, _ignoreArrowDirection));
}
}
if (node is Table)
{
Table t = node as Table;
foreach (Table.Row r in t.Rows)
{
foreach (Arrow a in r.IncomingArrows)
{
// Ignore non-layoutable objects
if (a.IgnoreLayout)
continue;
if (a.Origin.Frozen)
continue;
if (!a.IsConnected)
continue;
// Add only if it comes from outside the group
if (!nodes.Contains(a.Origin))
{
// Use the factory to create the adapter link.
// That way, if the adapter for the arrow already
// exists, it will be returned instead of creating a
// new adapter.
links.Add(factory.CreateLink(a,
_keepGroups, _ignoreArrowDirection));
}
}
}
}
}
return links;
}