示例#1
0
        public override bool CanAppend(UndoRedoAction action)
        {
            EditPropertyAction castAction = action as EditPropertyAction;

            if (castAction == null)
            {
                return(false);
            }
            if (castAction.targetProperty != this.targetProperty)
            {
                return(false);
            }
            if (!castAction.targetObj.SequenceEqual(this.targetObj))
            {
                return(false);
            }

            // If we're using an indexer, make sure both actions do and use the same indices
            if (castAction.targetIndices != null || this.targetIndices != null)
            {
                if (castAction.targetIndices == null || this.targetIndices == null)
                {
                    return(false);
                }
                if (!castAction.targetIndices.SequenceEqual(this.targetIndices))
                {
                    return(false);
                }
            }

            return(true);
        }
示例#2
0
        public override void Append(UndoRedoAction action, bool performAction)
        {
            base.Append(action, performAction);
            EditPropertyAction castAction = action as EditPropertyAction;

            if (performAction)
            {
                castAction.backupValue = this.backupValue;
                castAction.Do();
            }
            this.targetValue = castAction.targetValue ?? this.targetValue;
        }
示例#3
0
        public override bool CanAppend(UndoRedoAction action)
        {
            EditPropertyAction castAction = action as EditPropertyAction;

            if (castAction == null)
            {
                return(false);
            }
            if (castAction.targetProperty != this.targetProperty)
            {
                return(false);
            }
            if (!castAction.targetObj.SequenceEqual(this.targetObj))
            {
                return(false);
            }

            return(true);
        }