public GoToModuleMouseHandler( DTE2 app, IWpfTextView view, IOleCommandTarget commandTarget, IClassifier aggregator, ITextStructureNavigator navigator, CtrlKeyState state) { this.App = app; _view = view; _commandTarget = commandTarget; _state = state; _aggregator = aggregator; _navigator = navigator; _state.CtrlKeyStateChanged += (sender, args) => { if (_state.Enabled) { this.TryHighlightItemUnderMouse(RelativeToView(Mouse.PrimaryDevice.GetPosition(_view.VisualElement))); } else { this.SetHighlightSpan(null); } }; _view.LostAggregateFocus += (sender, args) => this.SetHighlightSpan(null); _view.VisualElement.MouseLeave += (sender, args) => this.SetHighlightSpan(null); }
public IMouseProcessor GetAssociatedProcessor(IWpfTextView view) { if (App.OptionsPage?.DisableShiftClick == null) { return(null); } var buffer = view.TextBuffer; IOleCommandTarget shellCommandDispatcher = GetShellCommandDispatcher(view); if (shellCommandDispatcher == null) { return(null); } return(new GoToModuleMouseHandler( (DTE2)GlobalServiceProvider.GetService(typeof(SDTE)), view, shellCommandDispatcher, AggregatorFactory.GetClassifier(buffer), NavigatorService.GetTextStructureNavigator(buffer), CtrlKeyState.GetStateForView(view))); }
public GoToModuleKeyProcessor(CtrlKeyState state) { _state = state; }
public KeyProcessor GetAssociatedProcessor(IWpfTextView view) { return(view.Properties.GetOrCreateSingletonProperty(typeof(GoToModuleKeyProcessor), () => new GoToModuleKeyProcessor(CtrlKeyState.GetStateForView(view)))); }