/// <summary> /// トランザクションを開始します。 /// </summary> /// <param name="merge">真の場合はオペレーションをマージします。</param> /// <returns>使用するオペレーショントランザクションのインスタンスを返します。</returns> public OperationTransaction BeginTransaction(bool merge) { lock (this.SyncObj) { if (this.transaction == null) { this.transaction = new OperationTransaction(this, merge); } return this.transaction; } }
/// <summary> /// トランザクションを終了します。 /// </summary> public void EndTransaction() { lock (this.SyncObj) { if (this.transaction != null) { OperationGroup operationGroup = this.transaction.OperationGroup; this.transaction = null; this.Run(operationGroup); } } }
/// <summary> /// アンドゥ対象になっているオペレーションなど状態をクリアします。 /// </summary> public void Clear() { lock (this.SyncObj) { this.undoList.Clear(); this.redoList.Clear(); this.transaction = null; } }