Beispiel #1
0
        public void MoveByWithHistory(decimal dx, decimal dy, IHistory history)
        {
            var previous = new { DeltaX = -dx, DeltaY = -dy, Shape };
            var next     = new { DeltaX = dx, DeltaY = dy, Shape };

            history.Snapshot(previous, next, (s) => s.Shape.Move(null, s.DeltaX, s.DeltaY));
            Shape.Move(null, dx, dy);
        }
Beispiel #2
0
        private static void MoveShapeByWithHistory(IBaseShape shape, double dx, double dy, IHistory history)
        {
            var previous = new { DeltaX = -dx, DeltaY = -dy, shape };
            var next     = new { DeltaX = dx, DeltaY = dy, shape };

            history.Snapshot(previous, next, (s) => s.shape.Move(null, s.DeltaX, s.DeltaY));
            shape.Move(null, dx, dy);
        }