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

            ErrorHandler.ThrowOnFailure(_mgr.CloseLinkedUndo());
            _isActive = false;
        }
            public void Commit()
            {
                AssertIsForeground();

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

                if (_transactionAlive)
                {
                    _service.ActiveTransactions--;

                    var result = _undoManager.CloseLinkedUndo();
                    if (result == VSConstants.UNDO_E_CLIENTABORT)
                    {
                        Dispose();
                    }
                    else
                    {
                        Marshal.ThrowExceptionForHR(result);
                        _transactionAlive = false;
                    }
                }
            }
コード例 #3
0
 public void EndGlobalUndo(IVsLinkedUndoTransactionManager linkedUndo)
 {
     ErrorHandler.ThrowOnFailure(linkedUndo.CloseLinkedUndo());
 }
コード例 #4
0
 public void EndGlobalUndo(IVsLinkedUndoTransactionManager linkedUndo) {
     ErrorHandler.ThrowOnFailure(linkedUndo.CloseLinkedUndo());
 }