Пример #1
0
        private int RemoveDropDownBar()
        {
            var cpc = (IConnectionPointContainer)_window;

            if (cpc != null)
            {
                IConnectionPoint cp;
                cpc.FindConnectionPoint(typeof(IVsCodeWindowEvents).GUID, out cp);
                if (cp != null)
                {
                    cp.Unadvise(_cookieVsCodeWindowEvents);
                }
            }

            if (_client != null)
            {
                IVsDropdownBarManager manager = (IVsDropdownBarManager)_window;
                _client.Unregister();
                // A buffer may have multiple DropDownBarClients, given one may open multiple CodeWindows
                // over a single buffer using Window/New Window
                List <DropDownBarClient> listDropDownBarClient;
                if (_textBuffer.Properties.TryGetProperty(typeof(DropDownBarClient), out listDropDownBarClient) && listDropDownBarClient != null)
                {
                    listDropDownBarClient.Remove(_client);
                    if (listDropDownBarClient.Count == 0)
                    {
                        _textBuffer.Properties.RemoveProperty(typeof(DropDownBarClient));
                    }
                }
                _client = null;
                return(manager.RemoveDropdownBar());
            }
            return(VSConstants.S_OK);
        }
Пример #2
0
 private int RemoveDropDownBar()
 {
     if (_client != null)
     {
         IVsDropdownBarManager manager = (IVsDropdownBarManager)_window;
         _client.Unregister();
         _client = null;
         _textView.TextBuffer.Properties.RemoveProperty(typeof(DropDownBarClient));
         return(manager.RemoveDropdownBar());
     }
     return(VSConstants.S_OK);
 }
Пример #3
0
        private int RemoveDropDownBar()
        {
            var cpc = (IConnectionPointContainer)_window;

            if (cpc != null)
            {
                IConnectionPoint cp;
                cpc.FindConnectionPoint(typeof(IVsCodeWindowEvents).GUID, out cp);
                if (cp != null)
                {
                    cp.Unadvise(_cookieVsCodeWindowEvents);
                }
            }

            if (_client != null)
            {
                return(_client.Unregister((IVsDropdownBarManager)_window));
            }
            return(VSConstants.S_OK);
        }