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); }
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))); }
public GoToModuleKeyProcessor(CtrlKeyState state) { _state = state; }
public KeyProcessor GetAssociatedProcessor(IWpfTextView view) { return(view.Properties.GetOrCreateSingletonProperty(typeof(GoToModuleKeyProcessor), () => new GoToModuleKeyProcessor(CtrlKeyState.GetStateForView(view)))); }