예제 #1
0
 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()));
     }
 }
예제 #2
0
        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()));
            }
        }