GetStateForView() static private method

static private GetStateForView ( ITextView view ) : CtrlKeyState
view ITextView
return CtrlKeyState
Ejemplo n.º 1
0
        public IMouseProcessor GetAssociatedProcessor(IWpfTextView view)
        {
            var buffer = view.TextBuffer;

            IOleCommandTarget shellCommandDispatcher = GetShellCommandDispatcher(view);

            if (shellCommandDispatcher == null)
            {
                return(null);
            }

            ITelemetrySession   telemetrySession = TelemetrySessionForPPT.Create(typeof(GoToDefMouseHandler).Assembly);
            IVsExtensionManager manager          = _globalServiceProvider.GetService(typeof(SVsExtensionManager)) as IVsExtensionManager;

            if (manager == null)
            {
                return(null);
            }

            IInstalledExtension extension;

            manager.TryGetInstalledExtension("GoToDef", out extension);
            if (extension != null)
            {
                return(null);
            }

            return(new GoToDefMouseHandler(view,
                                           shellCommandDispatcher,
                                           telemetrySession,
                                           _aggregatorFactory.GetClassifier(buffer),
                                           _navigatorService.GetTextStructureNavigator(buffer),
                                           CtrlKeyState.GetStateForView(view)));
        }
Ejemplo n.º 2
0
        public IMouseProcessor GetAssociatedProcessor(IWpfTextView view)
        {
            var buffer = view.TextBuffer;

            IOleCommandTarget shellCommandDispatcher = GetShellCommandDispatcher(view);

            if (shellCommandDispatcher == null)
                return null;

            return new GoToDefMouseHandler(view,
                                           shellCommandDispatcher,
                                           AggregatorFactory.GetClassifier(buffer),
                                           NavigatorService.GetTextStructureNavigator(buffer),
                                           CtrlKeyState.GetStateForView(view));
        }
Ejemplo n.º 3
0
        public KeyProcessor GetAssociatedProcessor(IWpfTextView view)
        {
            IVsExtensionManager manager = _serviceProvider.GetService(typeof(SVsExtensionManager)) as IVsExtensionManager;

            if (manager == null)
            {
                return(null);
            }

            IInstalledExtension extension;

            manager.TryGetInstalledExtension("GoToDef", out extension);
            if (extension != null)
            {
                return(null);
            }

            return(view.Properties.GetOrCreateSingletonProperty(typeof(GoToDefKeyProcessor),
                                                                () => new GoToDefKeyProcessor(CtrlKeyState.GetStateForView(view))));
        }
Ejemplo n.º 4
0
 public KeyProcessor GetAssociatedProcessor(IWpfTextView view)
 {
     return(view.Properties.GetOrCreateSingletonProperty(typeof(GoToDefKeyProcessor),
                                                         () => new GoToDefKeyProcessor(CtrlKeyState.GetStateForView(view))));
 }