示例#1
0
        public void OnContainerCreated(Ankh.UI.VSContainerForm form)
        {
            VSCommandRouting routing = VSCommandRouting.FromForm(form);

            if (routing != null)
            {
                routing.OnHandleCreated();
            }
        }
示例#2
0
        public void OnContainerCreated(Ankh.UI.VSContainerForm form)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            VSCommandRouting routing = VSCommandRouting.FromForm(form);

            if (routing != null)
            {
                routing.OnHandleCreated();
            }
        }
示例#3
0
        public void AddCommandTarget(Ankh.UI.VSContainerForm form, IOleCommandTarget commandTarget)
        {
            VSCommandRouting routing = VSCommandRouting.FromForm(form);

            if (routing != null)
            {
                routing.AddCommandTarget(commandTarget);
            }
            else
            {
                throw new InvalidOperationException("Command routing not initialized yet");
            }
        }
示例#4
0
        public void AddWindowPane(Ankh.UI.VSContainerForm form, IVsWindowPane pane)
        {
            VSCommandRouting routing = VSCommandRouting.FromForm(form);

            if (routing != null)
            {
                routing.AddWindowPane(pane);
            }
            else
            {
                throw new InvalidOperationException("Command routing not initialized yet");
            }
        }
示例#5
0
        public VSFormContainerPane(IAnkhServiceProvider context, VSCommandRouting routing, Panel panel)
            : base(context)
        {
            if (context == null)
                throw new ArgumentNullException("context");
            else if (routing == null)
                throw new ArgumentNullException("routing");
            else if (panel == null)
                throw new ArgumentNullException("panel");

            _routing = routing;
            _panel = panel;
        }
示例#6
0
        public VSFormContainerPane(IAnkhServiceProvider context, VSCommandRouting routing, Panel panel)
            : base(context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            else if (routing == null)
            {
                throw new ArgumentNullException("routing");
            }
            else if (panel == null)
            {
                throw new ArgumentNullException("panel");
            }

            _routing = routing;
            _panel   = panel;
        }
示例#7
0
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (_priorityCommandTarget != null)
                {
                    try
                    {
                        _priorityCommandTarget.UnregisterPriorityCommandTarget(_csCookie);
                    }
                    finally
                    {
                        _priorityCommandTarget = null;
                    }
                }

                if (_activeStack != null)
                {
                    try
                    {
                        _activeStack.Dispose();
                    }
                    finally
                    {
                        _activeStack = null;
                    }
                }


                if (_panel != null)
                {
                    RestoreLayout();
                }

                if (_pane != null)
                {
                    _pane.Dispose(); // Unhook
                    _pane = null;
                }

                if (_panel != null)
                {
                    _panel.Dispose();
                    _panel = null;
                }
            }
            finally
            {
                _map.Remove(_form);

                if (_installed)
                {
                    _installed = false;
                    Application.RemoveMessageFilter(this);

                    VSCommandRouting cr = _routers.Pop();
                    Debug.Assert(cr == this, "Pop routing in the right order");

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

                base.Dispose(disposing);
            }
        }