示例#1
0
		public virtual object Clone()
		{
			NodeCollection result = new NodeCollection();

			foreach (INode node in List)
				result.Add(node);

			return result;
		}
示例#2
0
		private void Build(bool keepGroups, bool ignoreArrowDirection)
		{
			IFactory factory = CreateFactory();

			// Collect nodes
			_nodes = new NodeCollection();

			// Traverse all boxes
			foreach (Box b in _chart.Boxes)
			{
				// Ignore non-layoutable nodes
				if (b.Frozen)
					continue;

				if (keepGroups)
				{
					// Add only masters
					if (b.MasterGroup == null ||
						b.MasterGroup.MainObject is Arrow)
						_nodes.Add(factory.CreateNode(b,
							keepGroups, ignoreArrowDirection));
				}
				else
				{
					_nodes.Add(factory.CreateNode(b,
						keepGroups, ignoreArrowDirection));
				}
			}

			foreach (ControlHost h in _chart.ControlHosts)
			{
				// Ignore non-layoutable nodes
				if (h.Frozen)
					continue;

				if (keepGroups)
				{
					// Add only masters
					if (h.MasterGroup == null ||
						h.MasterGroup.MainObject is Arrow)
						_nodes.Add(factory.CreateNode(h,
							keepGroups, ignoreArrowDirection));
				}
				else
				{
					_nodes.Add(factory.CreateNode(h,
						keepGroups, ignoreArrowDirection));
				}
			}

			// Traverse all tables
			foreach (Table t in _chart.Tables)
			{
				// Ignore non-layoutable nodes
				if (t.Frozen)
					continue;

				if (keepGroups)
				{
					if (t.MasterGroup == null ||
						t.MasterGroup.MainObject is Arrow)
						_nodes.Add(factory.CreateNode(t,
							keepGroups, ignoreArrowDirection));
				}
				else
				{
					_nodes.Add(factory.CreateNode(t,
						keepGroups, ignoreArrowDirection));
				}
			}

			// Collect links
			_links = factory.Links;
		}