public void Execute()
        {
            textShape = new ShapeTextDecorator(shape);
            if (shape.GetType() == typeof(ShapeComposite))
            {
                ShapeComposite temp = (ShapeComposite)shape;
                textShape = new ShapeTextDecorator(temp.GetChildren()[0]);
                textShape.AddText(text, textPos);
                temp.GetChildren()[temp.GetChildren().FindIndex(ind => ind.Equals(temp.GetChildren()[0]))] = textShape;

                playground.AddShape(temp);
                playground.RemoveShape(shape);
            }
            else
            {
                textShape.AddText(text, textPos);

                playground.AddShape(textShape);
                playground.RemoveShape(shape);
            }
        }
Example #2
0
 public void Execute()
 {
     playground.RemoveShape(deletedShape);
 }
Example #3
0
 public void Undo()
 {
     playground.RemoveShape(currentShape);
 }