コード例 #1
0
 public override void Do()
 {
     for (int i = 0; i < actions.Count; i++)
     {
         DocLogger.WriteLineVerbose("DO: " + actions[i].ToString());
         actions[i].Do();
     }
 }
コード例 #2
0
 public override void Undo()
 {
     for (int i = actions.Count - 1; i >= 0; i--)
     {
         DocLogger.WriteLineVerbose("UNDO: " + actions[i].ToString());
         actions[i].Undo();
     }
 }
コード例 #3
0
        public override void Undo()
        {
            DocLogger.WriteLine(">>> Undo id=" + Id + " name=\"" + Name + "\"");

            base.Undo();

            DocLogger.WriteLine("<<<");
        }
コード例 #4
0
        private void RollBackTransaction()
        {
            CheckNotInAction();
            CheckInTransaction();

            Transaction tmp = transaction;

            transaction = null;

            tmp.Undo();

            DocLogger.WriteLine("<<< ROLLBACK");
        }
コード例 #5
0
        private void PerformUndo(IAtomicOperation action)
        {
            CheckNotInAction();

            DocLogger.WriteLineVerbose("Undo: " + action.ToString());

            try
            {
                currentlyInAction = true;

                action.Undo();
            }
            finally
            {
                currentlyInAction = false;
            }
        }
コード例 #6
0
        public void StartTransaction(int id, string name)
        {
            CheckThreadId();
            CheckNotInAction();
            CheckNotInTransaction();

            if (HasLastTransaction() && LastTransactionId() == id)
            {
                DocLogger.WriteLine(">>> StartTransaction.Restore id=" + id + " name=\"" + name + "\"");
                RestoreLastTransaction();
            }
            else
            {
                DocLogger.WriteLine(">>> StartTransaction.New id=" + id + " name=\"" + name + "\"");
                transaction = new Transaction(id, name);
            }
        }
コード例 #7
0
        public void EndTransaction()
        {
            CheckThreadId();
            CheckNotInAction();
            CheckInTransaction();

            Transaction tmp = transaction;

            transaction = null;

            if (tmp.HasActions)
            {
                usedTransactioIds.Add(tmp.Id);
                PerformAdd(tmp);
            }

            PerformNotifications();

            DocLogger.WriteLine("<<<");
        }