public void Do_Group() { List <BaseUMLObject> Target = new List <BaseUMLObject>(); foreach (BaseUMLShape shape in UMLShapes) { if (shape as BaseUMLObject != null) { BaseUMLObject obj = shape as BaseUMLObject; if (obj.getSelected()) { Target.Add(obj); } } } foreach (BaseUMLObject obj in Target) { obj.setSelected(false); UMLShapes.Remove(obj); } GroupUMLObject Group = new GroupUMLObject(CoreRectRange.Default()); Group.SetChildrens(Target); AddShape(Group); }
public void Do_ChangeObjectName() { List <BaseUMLObject> Target = new List <BaseUMLObject>(); foreach (BaseUMLShape shape in UMLShapes) { if (shape as BaseUMLObject != null) { BaseUMLObject obj = shape as BaseUMLObject; if (obj.getSelected()) { Target.Add(obj); } } } if (Target.Count == 1) { if (Target.ElementAt(0) as ClassUMLObject != null) { ClassUMLObject temp = Target.ElementAt(0) as ClassUMLObject; BasicInputDialog inputDialog = new BasicInputDialog("Please enter your new class name:", temp.getTitleText()); if (inputDialog.ShowDialog() == true) { temp.setTitleText(inputDialog.Answer); } } if (Target.ElementAt(0) as UseCaseUMLObject != null) { UseCaseUMLObject temp = Target.ElementAt(0) as UseCaseUMLObject; BasicInputDialog inputDialog = new BasicInputDialog("Please enter your new usecase name:", temp.getName()); if (inputDialog.ShowDialog() == true) { temp.setName(inputDialog.Answer); } } this.InvalidateVisual(); } }