//--------------------------------------------------------------------------------------------------

        public bool Set(IUndoableDataBlob dataBlobOwner)
        {
            InstanceGuid = dataBlobOwner.Guid;

            var data = dataBlobOwner.GetUndoDataBlob();
            if (data != null)
            {
                _StoredData = data;
                //Debug.WriteLine(_StoredData);
                return true;
            }
            return false;
        }
Esempio n. 2
0
        //--------------------------------------------------------------------------------------------------

        public void AddDataBlockChange(IUndoableDataBlob instance)
        {
            // Note: Only the first value change should be saved, or the original state will be lost.
            var action = (DataBlobUndoAction)_PendingActions.FirstOrDefault(a => a.InstanceGuid.Equals(instance.Guid) && a is DataBlobUndoAction);

            if (action != null)
            {
                return;
            }

            action = new DataBlobUndoAction(instance.Guid);
            if (action.Set(instance))
            {
                _PendingActions.Add(action);
            }
        }