Example #1
0
        public void VsTextViewCreated(IVsTextView tva)
        {
            var tv = EditorFactory.GetWpfTextView(tva);

            if (tv == null)
            {
                return;
            }

            var cf = new TacticsKeyBindingFilter(tv);

            if (cf.Added)
            {
                return;
            }

            IOleCommandTarget next;
            var hr = tva.AddCommandFilter(cf, out next);

            if (hr != VSConstants.S_OK)
            {
                return;
            }

            cf.Added = true;
            if (next != null)
            {
                cf.Next = next;
            }
        }
Example #2
0
    public void VsTextViewCreated(IVsTextView tva)
    {
      var tv = EditorFactory.GetWpfTextView(tva);
      if (tv == null) return;

      var cf = new TacticsKeyBindingFilter(tv);
      if (cf.Added) return;

      IOleCommandTarget next;
      var hr = tva.AddCommandFilter(cf, out next);
      if (hr != VSConstants.S_OK) return;

      cf.Added = true;
      if (next != null) cf.Next = next;
    }