public override void Do() { for (int i = 0; i < actions.Count; i++) { DocLogger.WriteLineVerbose("DO: " + actions[i].ToString()); actions[i].Do(); } }
public override void Undo() { for (int i = actions.Count - 1; i >= 0; i--) { DocLogger.WriteLineVerbose("UNDO: " + actions[i].ToString()); actions[i].Undo(); } }
public override void Undo() { DocLogger.WriteLine(">>> Undo id=" + Id + " name=\"" + Name + "\""); base.Undo(); DocLogger.WriteLine("<<<"); }
private void RollBackTransaction() { CheckNotInAction(); CheckInTransaction(); Transaction tmp = transaction; transaction = null; tmp.Undo(); DocLogger.WriteLine("<<< ROLLBACK"); }
private void PerformUndo(IAtomicOperation action) { CheckNotInAction(); DocLogger.WriteLineVerbose("Undo: " + action.ToString()); try { currentlyInAction = true; action.Undo(); } finally { currentlyInAction = false; } }
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); } }
public void EndTransaction() { CheckThreadId(); CheckNotInAction(); CheckInTransaction(); Transaction tmp = transaction; transaction = null; if (tmp.HasActions) { usedTransactioIds.Add(tmp.Id); PerformAdd(tmp); } PerformNotifications(); DocLogger.WriteLine("<<<"); }