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); } }
public void Execute() { playground.RemoveShape(deletedShape); }
public void Undo() { playground.RemoveShape(currentShape); }