示例#1
0
        public void SetDirty(bool dirty)
        {
            if (dirty == _isDirty)
            {
                return;
            }

            _isDirty = dirty;

            if (!_isFileDocument)
            {
                return;
            }

            IFileStatusMonitor monitor = GetService <IFileStatusMonitor>();

            if (monitor != null)
            {
                monitor.SetDocumentDirty(FullPath, dirty);
            }

            ISelectionContextEx selection = GetService <ISelectionContextEx>(typeof(ISelectionContext));

            if (selection != null)
            {
                selection.MaybeInstallDelayHandler();
            }
        }
示例#2
0
        public VSCommandRouting(IAnkhServiceProvider context, VSContainerForm form)
            : base(context)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (form == null)
            {
                throw new ArgumentNullException("form");
            }

            _form   = form;
            _vsForm = form;

            if (_routers.Count > 0)
            {
                _routers.Peek().Enabled = false;
            }

            Application.AddMessageFilter(this);
            _routers.Push(this);
            _installed = true;
            _vsWpf     = !VSVersion.VS2008OrOlder;
            _map.Add(form, this);

            _priorityCommandTarget = GetService <IVsRegisterPriorityCommandTarget>(typeof(SVsRegisterPriorityCommandTarget));

            if (_priorityCommandTarget != null)
            {
                if (!VSErr.Succeeded(_priorityCommandTarget.RegisterPriorityCommandTarget(0, this, out _csCookie)))
                {
                    _priorityCommandTarget = null;
                }
            }

            ISelectionContextEx sel = GetService <ISelectionContextEx>(typeof(ISelectionContext));

            if (sel != null)
            {
                _activeStack = sel.PushPopupContext(form);
            }
        }