Пример #1
0
        /// <inheritdoc />
        public void AppendRemove(IPersistedData parent, IPersistedData child, long txtime, IMutableStat prevChildStat, IMutableStat prevParentStat, Action recordUndeleteAction)
        {
            if (child == null)
            {
                throw new ArgumentNullException("child");
            }

            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            if (prevChildStat == null)
            {
                throw new ArgumentNullException("prevChildStat");
            }

            if (prevParentStat == null)
            {
                throw new ArgumentNullException("prevParentStat");
            }

            if (recordUndeleteAction == null)
            {
                throw new ArgumentNullException("recordUndeleteAction");
            }

            if (this.changelist == null)
            {
                this.changelist = this.createChangeList();
            }

            child.AppendRemove(this.changelist, parent);

            if (this.changelist != null)
            {
                this.changelist.SetTime(txtime);
            }

            if (this.isLockDown)
            {
                return;
            }

            this.RunOnAbort(() =>
            {
                this.ValidateLockList(parent, Perm.WRITE, null, Perm.NONE);

                recordUndeleteAction();

                parent.Node.AddChild(child.Node);
                child.Stat  = prevChildStat;
                parent.Stat = prevParentStat;
            });
        }
Пример #2
0
        /// <inheritdoc />
        public void AppendRemoveNodeAndAllChildren(IPersistedData child, long txtime, Action recordUndeleteAction)
        {
            if (child == null)
            {
                throw new ArgumentNullException("child");
            }

            if (recordUndeleteAction != null)
            {
                this.RunOnAbort(recordUndeleteAction);
            }

            if (this.changelist == null)
            {
                this.changelist = this.createChangeList();
            }

            child.AppendRemove(this.changelist, child.Parent, true);

            if (this.changelist != null)
            {
                this.changelist.SetTime(txtime);
            }
        }