Exemplo n.º 1
0
        /// <summary>
        /// Does nothing unless overridden.
        /// </summary>
        /// <remarks>
        /// If you override <see cref="ComposableLutBase.CreateMemento"/> to capture the Lut's state, you must also override this method
        /// to allow the state to be restored.
        /// </remarks>
        /// <param name="memento">The memento object from which to restore the Lut's state.</param>
        /// <exception cref="InvalidOperationException">Thrown if <paramref name="memento"/> is <B>not</B> null,
        /// which would indicate that <see cref="ComposableLutBase.CreateMemento"/> has been overridden, but <see cref="ComposableLutBase.SetMemento"/> has not.</exception>
        public override void SetMemento(object memento)
        {
            Platform.CheckForNullReference(memento, "memento");
            Memento lutMemento = (Memento)memento;

            if (lutMemento.DataLutMemento != null)
            {
                _dataLut.SetMemento(lutMemento.DataLutMemento);
            }

            if (lutMemento.LinearLutMemento != null)
            {
                _linearLut.SetMemento(lutMemento.LinearLutMemento);
            }
        }