コード例 #1
0
        /// <summary>
        /// Aborts a linked undo transaction.
        /// </summary>
        public void Rollback()
        {
            if (!IsActive)
            {
                throw new InvalidOperationException("This operation can only be performed when a transaction is active.");
            }

            ErrorHandler.ThrowOnFailure(_mgr.AbortLinkedUndo());
            _isActive = false;
        }
            public void Dispose()
            {
                AssertIsForeground();

                // once either commit or disposed is called, don't do finalizer check
                GC.SuppressFinalize(this);

                if (_transactionAlive)
                {
                    _service.ActiveTransactions--;

                    Marshal.ThrowExceptionForHR(_undoManager.AbortLinkedUndo());
                    _transactionAlive = false;
                }
            }