/// <summary> /// Creates a memento for this object. /// </summary> /// <remarks>Typically used in conjunction with <see cref="MemorableUndoableCommand"/> /// to support undo/redo.</remarks> public virtual object CreateMemento() { SpatialTransformMemento memento = new SpatialTransformMemento(); memento.FlipX = this.FlipX; memento.FlipY = this.FlipY; memento.RotationXY = this.RotationXY; memento.Scale = this.Scale; memento.TranslationX = this.TranslationX; memento.TranslationY = this.TranslationY; return(memento); }
/// <summary> /// Sets a memento for this object. /// </summary> /// <remarks>Typically used in conjunction with <see cref="MemorableUndoableCommand"/> /// to support undo/redo.</remarks> /// <exception cref="ArgumentNullException"><b>memento</b> /// is <b>null</b>.</exception> /// <exception cref="InvalidCastException"><b>memento</b> /// is not of the type expected by the object.</exception> public virtual void SetMemento(object memento) { Platform.CheckForNullReference(memento, "memento"); SpatialTransformMemento spatialTransformMemento = (SpatialTransformMemento)memento; this.FlipX = spatialTransformMemento.FlipX; this.FlipY = spatialTransformMemento.FlipY; this.RotationXY = spatialTransformMemento.RotationXY; this.Scale = spatialTransformMemento.Scale; this.TranslationX = spatialTransformMemento.TranslationX; this.TranslationY = spatialTransformMemento.TranslationY; this.RecalculationRequired = true; }