예제 #1
0
		/// <summary>
		/// Creates a new hierarchical group.
		/// </summary>
		/// <param name="mainObj">The group master item; the subordinated items will follow the
		/// master one when it is moved around.</param>
		/// <returns>A new Group instance.</returns>
		public Group CreateGroup(ChartObject mainObj)
		{
			if (mainObj == null) return null;

			Group group = new Group(this);
			if (group.setMainObject(mainObj))
			{
				AddGroupCmd cmd= new AddGroupCmd(mainObj, group);
				undoManager.executeCommand(cmd);
				return group;
			}
			else
			{
				group.onDelete();
				group = null;
				return null;
			}
		}
예제 #2
0
		/// <summary>
		/// Adds the specified group to the flowchart.
		/// </summary>
		/// <param name="group">A new Group object that should be added to the flowchart.</param>
		public void Add(Group group)
		{
			group.flowChart = this;
			AddGroupCmd cmd = new AddGroupCmd(group.MainObject, group);
			undoManager.executeCommand(cmd);
			setDirty();
		}