Ejemplo n.º 1
0
        public VenusCommandFilter(
            TLanguageService languageService,
            IWpfTextView wpfTextView,
            ICommandHandlerServiceFactory commandHandlerServiceFactory,
            ITextBuffer subjectBuffer,
            IOleCommandTarget nextCommandTarget,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService)
            : base(languageService, wpfTextView, editorAdaptersFactoryService, commandHandlerServiceFactory)
        {
            Contract.ThrowIfNull(wpfTextView);
            Contract.ThrowIfNull(subjectBuffer);
            Contract.ThrowIfNull(nextCommandTarget);

            _subjectBuffer  = subjectBuffer;
            CurrentHandlers = commandHandlerServiceFactory.GetService(subjectBuffer);
            // Setup all command handlers migrated to the modern editor commandig to be execited next
            var componentModel = Shell.ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel)) as IComponentModel;
            var vsCommandHandlerServiceAdapterFactory = componentModel?.GetService <IVsCommandHandlerServiceAdapterFactory>();

            if (vsCommandHandlerServiceAdapterFactory != null)
            {
                var vsCommandHandlerServiceAdapter = vsCommandHandlerServiceAdapterFactory.Create(wpfTextView, _subjectBuffer, nextCommandTarget);
                NextCommandTarget = vsCommandHandlerServiceAdapter;
            }
            else
            {
                NextCommandTarget = nextCommandTarget;
            }
        }
Ejemplo n.º 2
0
 public AbstractVsTextViewFilter(
     IWpfTextView wpfTextView,
     ICommandHandlerServiceFactory commandHandlerServiceFactory,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     IServiceProvider systemServiceProvider)
     : base(wpfTextView, commandHandlerServiceFactory, editorAdaptersFactoryService, systemServiceProvider)
 {
 }
 public AbstractVsTextViewFilter(
     IWpfTextView wpfTextView,
     ICommandHandlerServiceFactory commandHandlerServiceFactory,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     IServiceProvider systemServiceProvider)
     : base(wpfTextView, commandHandlerServiceFactory, editorAdaptersFactoryService, systemServiceProvider)
 {
 }
Ejemplo n.º 4
0
 public CSharpVsInteractiveWindowCommandProvider(
     ICommandHandlerServiceFactory commandHandlerServiceFactory,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     SVsServiceProvider serviceProvider)
 {
     _commandHandlerServiceFactory = commandHandlerServiceFactory;
     _editorAdaptersFactory        = editorAdaptersFactoryService;
     _serviceProvider = serviceProvider;
 }
 public CSharpVsInteractiveWindowCommandProvider(
     ICommandHandlerServiceFactory commandHandlerServiceFactory,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     SVsServiceProvider serviceProvider)
 {
     _commandHandlerServiceFactory = commandHandlerServiceFactory;
     _editorAdaptersFactory = editorAdaptersFactoryService;
     _serviceProvider = serviceProvider;
 }
 protected AbstractVsTextViewFilter(
     AbstractLanguageService <TPackage, TLanguageService> languageService,
     IWpfTextView wpfTextView,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     ICommandHandlerServiceFactory commandHandlerServiceFactory)
     : base(wpfTextView, commandHandlerServiceFactory, editorAdaptersFactoryService, languageService.SystemServiceProvider)
 {
     LanguageService = languageService;
 }
Ejemplo n.º 7
0
 public SaveEventsService(
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     ICommandHandlerServiceFactory commandHandlerServiceFactory,
     SVsServiceProvider serviceProvider)
 {
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _commandHandlerServiceFactory = commandHandlerServiceFactory;
     _runningDocumentTable         = (IVsRunningDocumentTable)serviceProvider.GetService(typeof(SVsRunningDocumentTable));
     _textManager = (IVsTextManager)serviceProvider.GetService(typeof(SVsTextManager));
 }
Ejemplo n.º 8
0
 public SaveEventsService(
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     ICommandHandlerServiceFactory commandHandlerServiceFactory,
     SVsServiceProvider serviceProvider)
 {
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _commandHandlerServiceFactory = commandHandlerServiceFactory;
     _runningDocumentTable = (IVsRunningDocumentTable)serviceProvider.GetService(typeof(SVsRunningDocumentTable));
     _textManager = (IVsTextManager)serviceProvider.GetService(typeof(SVsTextManager));
 }
Ejemplo n.º 9
0
 public VenusCommandFilter(
     TLanguageService languageService,
     IWpfTextView wpfTextView,
     ICommandHandlerServiceFactory commandHandlerServiceFactory,
     ITextBuffer subjectBuffer,
     IOleCommandTarget nextCommandTarget,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService)
     : this(languageService, wpfTextView, subjectBuffer, nextCommandTarget, editorAdaptersFactoryService)
 {
 }
Ejemplo n.º 10
0
 public DebuggerIntelliSenseFilter(
     AbstractLanguageService <TPackage, TLanguageService, TProject> languageService,
     IWpfTextView wpfTextView,
     IVsEditorAdaptersFactoryService adapterFactory,
     ICommandHandlerServiceFactory commandFactory)
     : base(languageService, wpfTextView, adapterFactory, commandFactory)
 {
     _wpfTextView    = wpfTextView;
     _commandFactory = commandFactory;
 }
Ejemplo n.º 11
0
 public VenusCommandFilter(
     TLanguageService languageService,
     IWpfTextView wpfTextView,
     ICommandHandlerServiceFactory commandHandlerServiceFactory,
     ITextBuffer subjectBuffer,
     IOleCommandTarget nextCommandTarget,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService)
     : base(wpfTextView, subjectBuffer, nextCommandTarget, languageService.Package.ComponentModel)
 {
 }
Ejemplo n.º 12
0
 internal XamlOleCommandTarget(
     IWpfTextView wpfTextView,
     ICommandHandlerServiceFactory commandHandlerServiceFactory,
     IVsEditorAdaptersFactoryService editorAdaptersFactory,
     IServiceProvider serviceProvider)
     : base(wpfTextView, commandHandlerServiceFactory, editorAdaptersFactory, serviceProvider)
 {
     wpfTextView.Closed += OnTextViewClosed;
     wpfTextView.BufferGraph.GraphBufferContentTypeChanged += OnGraphBuffersChanged;
     wpfTextView.BufferGraph.GraphBuffersChanged           += OnGraphBuffersChanged;
 }
Ejemplo n.º 13
0
 internal XamlOleCommandTarget(
     IWpfTextView wpfTextView,
     ICommandHandlerServiceFactory commandHandlerServiceFactory,
     IVsEditorAdaptersFactoryService editorAdaptersFactory,
     IServiceProvider serviceProvider)
     : base(wpfTextView, commandHandlerServiceFactory, editorAdaptersFactory, serviceProvider)
 {
     wpfTextView.Closed += OnTextViewClosed;
     wpfTextView.BufferGraph.GraphBufferContentTypeChanged += OnGraphBuffersChanged;
     wpfTextView.BufferGraph.GraphBuffersChanged += OnGraphBuffersChanged;
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Creates a new command handler that is attached to an IVsTextView.
        /// </summary>
        /// <param name="wpfTextView">The IWpfTextView of the view.</param>
        /// <param name="commandHandlerServiceFactory">The MEF imported ICommandHandlerServiceFactory.</param>
        /// <param name="editorAdaptersFactoryService">The editor adapter</param>
        /// <param name="languageService">The language service</param>
        internal StandaloneCommandFilter(
            IServiceProvider serviceProvider,
            IWpfTextView wpfTextView,
            ICommandHandlerServiceFactory commandHandlerServiceFactory,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService)
            : base(wpfTextView, commandHandlerServiceFactory, editorAdaptersFactoryService, serviceProvider)
        {
            wpfTextView.Closed += OnTextViewClosed;
            wpfTextView.BufferGraph.GraphBufferContentTypeChanged += OnGraphBuffersChanged;
            wpfTextView.BufferGraph.GraphBuffersChanged           += OnGraphBuffersChanged;

            RefreshCommandFilters();
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Creates a new command handler that is attached to an IVsTextView.
        /// </summary>
        /// <param name="wpfTextView">The IWpfTextView of the view.</param>
        /// <param name="commandHandlerServiceFactory">The MEF imported ICommandHandlerServiceFactory.</param>
        /// <param name="editorAdaptersFactoryService">The editor adapter</param>
        /// <param name="languageService">The language service</param>
        internal StandaloneCommandFilter(
            TLanguageService languageService,
            IWpfTextView wpfTextView,
            ICommandHandlerServiceFactory commandHandlerServiceFactory,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService)
            : base(languageService, wpfTextView, editorAdaptersFactoryService, commandHandlerServiceFactory)
        {
            wpfTextView.Closed += OnTextViewClosed;
            wpfTextView.BufferGraph.GraphBufferContentTypeChanged += OnGraphBuffersChanged;
            wpfTextView.BufferGraph.GraphBuffersChanged           += OnGraphBuffersChanged;

            RefreshCommandFilters();
        }
Ejemplo n.º 16
0
        private RoslynCommandTarget(ITextView textView, ITextBuffer languageBuffer)
        {
            ICommandHandlerServiceFactory commandHandlerServiceFactory = CompositionManager.GetExportedValue <ICommandHandlerServiceFactory>();

            if (commandHandlerServiceFactory != null)
            {
                commandHandlerServiceFactory.Initialize(languageBuffer.ContentType.TypeName);

                CurrentHandlers = commandHandlerServiceFactory.GetService(languageBuffer);
            }

            _languageBuffer = languageBuffer;
            _textView       = textView;
        }
Ejemplo n.º 17
0
        public AbstractOleCommandTarget(
            IWpfTextView wpfTextView,
            ICommandHandlerServiceFactory commandHandlerServiceFactory,
            IVsEditorAdaptersFactoryService editorAdaptersFactory,
            System.IServiceProvider serviceProvider)
        {
            Contract.ThrowIfNull(wpfTextView);
            Contract.ThrowIfNull(commandHandlerServiceFactory);
            Contract.ThrowIfNull(editorAdaptersFactory);
            Contract.ThrowIfNull(serviceProvider);

            _wpfTextView = wpfTextView;
            _commandHandlerServiceFactory = commandHandlerServiceFactory;
            _editorAdaptersFactory = editorAdaptersFactory;
            _serviceProvider = serviceProvider;
        }
Ejemplo n.º 18
0
        public AbstractOleCommandTarget(
            IWpfTextView wpfTextView,
            ICommandHandlerServiceFactory commandHandlerServiceFactory,
            IVsEditorAdaptersFactoryService editorAdaptersFactory,
            System.IServiceProvider serviceProvider)
        {
            Contract.ThrowIfNull(wpfTextView);
            Contract.ThrowIfNull(commandHandlerServiceFactory);
            Contract.ThrowIfNull(editorAdaptersFactory);
            Contract.ThrowIfNull(serviceProvider);

            _wpfTextView = wpfTextView;
            _commandHandlerServiceFactory = commandHandlerServiceFactory;
            _editorAdaptersFactory        = editorAdaptersFactory;
            _serviceProvider = serviceProvider;
        }
Ejemplo n.º 19
0
        public VenusCommandFilter(
            TLanguageService languageService,
            IWpfTextView wpfTextView,
            ICommandHandlerServiceFactory commandHandlerServiceFactory,
            ITextBuffer subjectBuffer,
            IOleCommandTarget nextCommandTarget,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService)
            : base(languageService, wpfTextView, editorAdaptersFactoryService, commandHandlerServiceFactory)
        {
            Contract.ThrowIfNull(wpfTextView);
            Contract.ThrowIfNull(subjectBuffer);
            Contract.ThrowIfNull(nextCommandTarget);

            _subjectBuffer    = subjectBuffer;
            CurrentHandlers   = commandHandlerServiceFactory.GetService(subjectBuffer);
            NextCommandTarget = nextCommandTarget;
        }
Ejemplo n.º 20
0
        public XamlTextViewCreationListener(
            [Import(typeof(SVsServiceProvider))] System.IServiceProvider services,
            ICommandHandlerServiceFactory commandHandlerServiceFactory,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IXamlDocumentAnalyzerService analyzerService,
            VisualStudioWorkspaceImpl vsWorkspace)
        {
            _serviceProvider       = services;
            _commandHandlerService = commandHandlerServiceFactory;
            _editorAdaptersFactory = editorAdaptersFactoryService;
            _vsWorkspace           = vsWorkspace;
            _rdt        = new Lazy <RunningDocumentTable>(() => new RunningDocumentTable(_serviceProvider));
            _vsSolution = (IVsSolution)_serviceProvider.GetService(typeof(SVsSolution));

            AnalyzerService = analyzerService;

            if (ErrorHandler.Succeeded(_vsSolution.AdviseSolutionEvents(this, out var solutionEventsCookie)))
            {
                _solutionEventsCookie = solutionEventsCookie;
            }
        }
        public XamlTextViewCreationListener(
            [Import(typeof(SVsServiceProvider))] System.IServiceProvider services,
            ICommandHandlerServiceFactory commandHandlerServiceFactory,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IXamlDocumentAnalyzerService analyzerService,
            VisualStudioWorkspaceImpl vsWorkspace)
        {
            _serviceProvider = services;
            _commandHandlerService = commandHandlerServiceFactory;
            _editorAdaptersFactory = editorAdaptersFactoryService;
            _vsWorkspace = vsWorkspace;
            _rdt = new Lazy<RunningDocumentTable>(() => new RunningDocumentTable(_serviceProvider));
            _vsSolution = (IVsSolution)_serviceProvider.GetService(typeof(SVsSolution));

            AnalyzerService = analyzerService;

            uint solutionEventsCookie;
            if (ErrorHandler.Succeeded(_vsSolution.AdviseSolutionEvents(this, out solutionEventsCookie)))
            {
                _solutionEventsCookie = solutionEventsCookie;
            }
        }
Ejemplo n.º 22
0
        public VenusCommandFilter(
            TLanguageService languageService,
            IWpfTextView wpfTextView,
            ICommandHandlerServiceFactory commandHandlerServiceFactory,
            ITextBuffer subjectBuffer,
            IOleCommandTarget nextCommandTarget,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService)
            : base(languageService, wpfTextView, editorAdaptersFactoryService, commandHandlerServiceFactory)
        {
            Contract.ThrowIfNull(wpfTextView);
            Contract.ThrowIfNull(subjectBuffer);
            Contract.ThrowIfNull(nextCommandTarget);

            _subjectBuffer  = subjectBuffer;
            CurrentHandlers = commandHandlerServiceFactory.GetService(subjectBuffer);
            // Chain in editor command handler service. It will execute all our command handlers migrated to the modern editor commanding.
            var componentModel = (IComponentModel)languageService.SystemServiceProvider.GetService(typeof(SComponentModel));
            var vsCommandHandlerServiceAdapterFactory = componentModel.GetService <IVsCommandHandlerServiceAdapterFactory>();
            var vsCommandHandlerServiceAdapter        = vsCommandHandlerServiceAdapterFactory.Create(wpfTextView, _subjectBuffer, nextCommandTarget);

            NextCommandTarget = vsCommandHandlerServiceAdapter;
        }