Пример #1
0
        public LinkedUndoTransaction(LinkedTransactionFlags flags, string description, IServiceProvider host)
        {
            if (description == null)
                throw new ArgumentNullException("description");
            if (host == null)
                throw new ArgumentNullException("host");

            _mgr = (IVsLinkedUndoTransactionManager)host.GetService(typeof (IVsLinkedUndoTransactionManager));
            if (_mgr == null)
                throw new ArgumentNullException("host", "The host must provide IVsLinkedUndoTransactionManager service.");

            ErrorHandler.ThrowOnFailure(_mgr.OpenLinkedUndo((uint)flags, description));
            _isActive = true;
        }
            public WorkspaceUndoTransaction(
                ITextUndoHistoryRegistry undoHistoryRegistry,
                IVsLinkedUndoTransactionManager undoManager,
                Workspace workspace,
                string description,
                GlobalUndoService service)
                : base(assertIsForeground: true)
            {
                _undoHistoryRegistry = undoHistoryRegistry;
                _undoManager         = undoManager;
                _workspace           = workspace;
                _description         = description;
                _service             = service;

                Marshal.ThrowExceptionForHR(_undoManager.OpenLinkedUndo((uint)LinkedTransactionFlags2.mdtGlobal, _description));
                _transactionAlive = true;
            }
            public WorkspaceUndoTransaction(
                ITextUndoHistoryRegistry undoHistoryRegistry,
                IVsLinkedUndoTransactionManager undoManager,
                Workspace workspace,
                string description,
                GlobalUndoService service)
                : base(assertIsForeground: true)
            {
                _undoHistoryRegistry = undoHistoryRegistry;
                _undoManager = undoManager;
                _workspace = workspace;
                _description = description;
                _service = service;

                Marshal.ThrowExceptionForHR(_undoManager.OpenLinkedUndo((uint)LinkedTransactionFlags2.mdtGlobal, _description));
                _transactionAlive = true;
            }
Пример #4
0
        public LinkedUndoTransaction(LinkedTransactionFlags flags, string description, IServiceProvider host)
        {
            if (description == null)
            {
                throw new ArgumentNullException("description");
            }
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }

            _mgr = (IVsLinkedUndoTransactionManager)host.GetService(typeof(IVsLinkedUndoTransactionManager));
            if (_mgr == null)
            {
                throw new ArgumentNullException("host", "The host must provide IVsLinkedUndoTransactionManager service.");
            }

            ErrorHandler.ThrowOnFailure(_mgr.OpenLinkedUndo((uint)flags, description));
            _isActive = true;
        }