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


C# IFactory.CreateLink方法代码示例

本文整理汇总了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;
		}
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:89,代码来源:FCLayoutAdapters.cs


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