public void SetMemento(ShapeMemento memento) { shapes.Clear(); List<ShapeData> shapeData = memento.GetMemento(); foreach (ShapeData shape in shapeData) { shapes.Add(ShapeFactory.GetShapeInstance(shape.Type, shape.X, shape.Y, shape.Height, shape.Width, shape.LineWidth, shape.GetColor())); } }
public void SetMemento(ShapeMemento memento) { shapes.Clear(); List <ShapeData> shapeData = memento.GetMemento(); foreach (ShapeData shape in shapeData) { shapes.Add(ShapeFactory.GetShapeInstance(shape.Type, shape.X, shape.Y, shape.Height, shape.Width, shape.LineWidth, shape.GetColor())); } }