Ejemplo n.º 1
0
        public GoToModuleMouseHandler(
            DTE2 app,
            IWpfTextView view,
            //IOleCommandTarget commandTarget,
            IClassifier aggregator,
            ITextStructureNavigator navigator,
            CtrlKeyState state)
        {
            App         = app;
            _view       = view;
            _state      = state;
            _aggregator = aggregator;
            _navigator  = navigator;

            _state.CtrlKeyStateChanged += (sender, args) =>
            {
                if (_state.Enabled)
                {
                    TryHighlightItemUnderMouse(RelativeToView(Mouse.PrimaryDevice.GetPosition(_view.VisualElement)));
                }
                else
                {
                    SetHighlightSpan(null);
                }
            };

            _view.LostAggregateFocus       += (sender, args) => SetHighlightSpan(null);
            _view.VisualElement.MouseLeave += (sender, args) => SetHighlightSpan(null);
        }
Ejemplo n.º 2
0
        public IMouseProcessor GetAssociatedProcessor(IWpfTextView view)
        {
            if (App.OptionsPage?.DisableShiftClick == null)
            {
                return(null);
            }

            //if (!(GlobalServiceProvider.GetService(typeof(SUIHostCommandDispatcher)) is IOleCommandTarget shellCommandDispatcher))
            //    return null;

            return(new GoToModuleMouseHandler(
                       (DTE2)GlobalServiceProvider.GetService(typeof(SDTE)),
                       view,
                       //shellCommandDispatcher,
                       AggregatorFactory.GetClassifier(view.TextBuffer),
                       NavigatorService.GetTextStructureNavigator(view.TextBuffer),
                       CtrlKeyState.GetStateForView(view)));
        }
Ejemplo n.º 3
0
 public GoToModuleKeyProcessor(CtrlKeyState state)
 {
     _state = state;
 }
Ejemplo n.º 4
0
 public KeyProcessor GetAssociatedProcessor(IWpfTextView view)
 {
     return(view.Properties.GetOrCreateSingletonProperty(typeof(GoToModuleKeyProcessor),
                                                         () => new GoToModuleKeyProcessor(CtrlKeyState.GetStateForView(view))));
 }