Ejemplo n.º 1
0
        void AddCommandFilter(IVsTextView viewAdapter, KeyBindingCommandFilter commandFilter)
        {
            if (commandFilter.m_added == false)
            {
                //get the view adapter from the editor factory
                IOleCommandTarget next;
                int hr = viewAdapter.AddCommandFilter(commandFilter, out next);

                if (hr == VSConstants.S_OK)
                {
                    commandFilter.m_added = true;
                    //you'll need the next target for Exec and QueryStatus
                    if (next != null)
                    {
                        commandFilter.m_nextTarget = next;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        void AddCommandFilter(IVsTextView viewAdapter, KeyBindingCommandFilter commandFilter)
        {
            if (commandFilter.m_added == false) {
            //get the view adapter from the editor factory
            IOleCommandTarget next;
            int hr = viewAdapter.AddCommandFilter(commandFilter, out next);

            if (hr == VSConstants.S_OK) {
              commandFilter.m_added = true;
              //you'll need the next target for Exec and QueryStatus
              if (next != null)
            commandFilter.m_nextTarget = next;
            }
              }
        }