Exemplo n.º 1
0
        /// <summary>
        /// Perform redo of this command.
        /// </summary>
        public override void Redo()
        {
            //create a new group; use the standard GroupShape or the CollapsibleGroupShape for a painted group with collapse/expand features.
            //GroupShape group = new GroupShape(this.Controller.Model);
            CollapsibleGroupShape group = new CollapsibleGroupShape(this.controller.Model);
            //asign the entities to the group
            group.Entities.Clear();

            foreach (IDiagramEntity entity in bundle.Entities)
            {
                //this will be recursive if an entity is itself an IGroup
                entity.Group = group;
                group.Entities.Add(entity);
            }
            //add the new group to the layer
            this.Controller.Model.DefaultPage.DefaultLayer.Entities.Add(group);

            mGroup = group;

            //select the newly created group
            CollectionBase<IDiagramEntity> col = new CollectionBase<IDiagramEntity>();
            col.Add(mGroup);
            Selection.SelectedItems = col;
            mGroup.Invalidate();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Perform redo of this command.
        /// </summary>
        public override void Redo()
        {
            //create a new group; use the standard GroupShape or the CollapsibleGroupShape for a painted group with collapse/expand features.
            //GroupShape group = new GroupShape(this.Controller.Model);
            CollapsibleGroupShape group = new CollapsibleGroupShape(this.controller.Model);

            //asign the entities to the group
            group.Entities.Clear();

            foreach (IDiagramEntity entity in bundle.Entities)
            {
                //this will be recursive if an entity is itself an IGroup
                entity.Group = group;
                group.Entities.Add(entity);
            }
            //add the new group to the layer
            this.Controller.Model.DefaultPage.DefaultLayer.Entities.Add(group);

            mGroup = group;

            //select the newly created group
            CollectionBase <IDiagramEntity> col = new CollectionBase <IDiagramEntity>();

            col.Add(mGroup);
            Selection.SelectedItems = col;
            mGroup.Invalidate();
        }