Ejemplo n.º 1
0
            internal int LockTransaction(PpsUndoTransaction locked)
            {
                CheckBlockingTransaction();

                blockingTransaction = locked;
                return(GetRollbackIndex());
            }             // proc LockTransaction
Ejemplo n.º 2
0
        /// <summary>Creates a new undo/redo transaction.</summary>
        /// <param name="description">Description of the transaction.</param>
        /// <returns>Returns the transaction scope.</returns>
        public IPpsUndoTransaction BeginTransaction(string description)
        {
            currentUndoTransaction =
                currentUndoTransaction == null ?
                new PpsUndoRootTransaction(this, description) :
                currentUndoTransaction = new PpsUndoParentTransaction(currentUndoTransaction, description);

            return(currentUndoTransaction);
        }         // func BeginTransaction
Ejemplo n.º 3
0
            }             // proc LockTransaction

            internal void UnlockTransaction(bool commit, int rollbackIndex)
            {
                if (blockingTransaction == null)
                {
                    throw new InvalidOperationException(String.Format("No blocking transaction."));
                }

                // is a rollback needed
                if (!commit)
                {
                    RollbackToIndex(rollbackIndex);
                }

                // Close the current transaction
                blockingTransaction.CloseTransaction(commit);
                blockingTransaction = null;
                UpdateCurrentTransaction(this);
            }             // proc UnlockTransaction
Ejemplo n.º 4
0
 internal override void UpdateCurrentTransaction(PpsUndoTransaction trans)
 => parent.UpdateCurrentTransaction(trans);
Ejemplo n.º 5
0
 public PpsUndoParentTransaction(PpsUndoTransaction parent, string sDescription)
     : base(sDescription)
 {
     this.parent        = parent;
     this.rollbackIndex = parent.LockTransaction(this);
 }             // ctor
Ejemplo n.º 6
0
            }             // proc RollbackToIndex

            internal override void UpdateCurrentTransaction(PpsUndoTransaction trans)
            => manager.currentUndoTransaction = trans;
Ejemplo n.º 7
0
 internal abstract void UpdateCurrentTransaction(PpsUndoTransaction trans);