예제 #1
0
 public SourceExplorerHierarchyControllerFactory(
     ISynchronizationContextProvider synchronizationContextProvider,
     IFileSystemTreeSource fileSystemTreeSource,
     IVisualStudioPackageProvider visualStudioPackageProvider,
     IVsGlyphService vsGlyphService,
     IImageSourceFactory imageSourceFactory,
     IOpenDocumentHelper openDocumentHelper,
     IFileSystem fileSystem,
     IClipboard clipboard,
     IWindowsExplorer windowsExplorer,
     IDispatchThreadServerRequestExecutor dispatchThreadServerRequestExecutor,
     IEventBus eventBus,
     IGlobalSettingsProvider globalSettingsProvider,
     IDelayedOperationExecutor delayedOperationExecutor,
     IDispatchThread dispatchThread,
     IShowServerInfoService showServerInfoService)
 {
     _synchronizationContextProvider = synchronizationContextProvider;
     _fileSystemTreeSource           = fileSystemTreeSource;
     _visualStudioPackageProvider    = visualStudioPackageProvider;
     _vsGlyphService     = vsGlyphService;
     _imageSourceFactory = imageSourceFactory;
     _openDocumentHelper = openDocumentHelper;
     _fileSystem         = fileSystem;
     _clipboard          = clipboard;
     _windowsExplorer    = windowsExplorer;
     _dispatchThreadServerRequestExecutor = dispatchThreadServerRequestExecutor;
     _eventBus = eventBus;
     _globalSettingsProvider   = globalSettingsProvider;
     _delayedOperationExecutor = delayedOperationExecutor;
     _dispatchThread           = dispatchThread;
     _showServerInfoService    = showServerInfoService;
 }
 public SourceExplorerHierarchyControllerFactory(
   ISynchronizationContextProvider synchronizationContextProvider,
   IFileSystemTreeSource fileSystemTreeSource,
   IVisualStudioPackageProvider visualStudioPackageProvider,
   IVsGlyphService vsGlyphService,
   IImageSourceFactory imageSourceFactory,
   IOpenDocumentHelper openDocumentHelper,
   IFileSystem fileSystem,
   IClipboard clipboard,
   IWindowsExplorer windowsExplorer,
   IUIRequestProcessor uiRequestProcessor,
   IEventBus eventBus,
   IGlobalSettingsProvider globalSettingsProvider,
   IDelayedOperationProcessor delayedOperationProcessor,
   IUIThread uiThread) {
   _synchronizationContextProvider = synchronizationContextProvider;
   _fileSystemTreeSource = fileSystemTreeSource;
   _visualStudioPackageProvider = visualStudioPackageProvider;
   _vsGlyphService = vsGlyphService;
   _imageSourceFactory = imageSourceFactory;
   _openDocumentHelper = openDocumentHelper;
   _fileSystem = fileSystem;
   _clipboard = clipboard;
   _windowsExplorer = windowsExplorer;
   _uiRequestProcessor = uiRequestProcessor;
   _eventBus = eventBus;
   _globalSettingsProvider = globalSettingsProvider;
   _delayedOperationProcessor = delayedOperationProcessor;
   _uiThread = uiThread;
 }
 public SourceExplorerHierarchyControllerFactory(
     ISynchronizationContextProvider synchronizationContextProvider,
     IFileSystemTreeSource fileSystemTreeSource,
     IVisualStudioPackageProvider visualStudioPackageProvider,
     IVsGlyphService vsGlyphService,
     IImageSourceFactory imageSourceFactory,
     IOpenDocumentHelper openDocumentHelper,
     IFileSystem fileSystem,
     IClipboard clipboard,
     IWindowsExplorer windowsExplorer,
     IUIRequestProcessor uiRequestProcessor,
     IEventBus eventBus,
     IGlobalSettingsProvider globalSettingsProvider,
     IDelayedOperationProcessor delayedOperationProcessor,
     IUIThread uiThread)
 {
     _synchronizationContextProvider = synchronizationContextProvider;
     _fileSystemTreeSource           = fileSystemTreeSource;
     _visualStudioPackageProvider    = visualStudioPackageProvider;
     _vsGlyphService            = vsGlyphService;
     _imageSourceFactory        = imageSourceFactory;
     _openDocumentHelper        = openDocumentHelper;
     _fileSystem                = fileSystem;
     _clipboard                 = clipboard;
     _windowsExplorer           = windowsExplorer;
     _uiRequestProcessor        = uiRequestProcessor;
     _eventBus                  = eventBus;
     _globalSettingsProvider    = globalSettingsProvider;
     _delayedOperationProcessor = delayedOperationProcessor;
     _uiThread                  = uiThread;
 }
예제 #4
0
        public CodeSearchController(
            CodeSearchControl control,
            IDispatchThreadServerRequestExecutor dispatchThreadServerRequestExecutor,
            IDispatchThreadDelayedOperationExecutor dispatchThreadDelayedOperationExecutor,
            IFileSystemTreeSource fileSystemTreeSource,
            ITypedRequestProcessProxy typedRequestProcessProxy,
            IProgressBarTracker progressBarTracker,
            IStandarImageSourceFactory standarImageSourceFactory,
            IWindowsExplorer windowsExplorer,
            IClipboard clipboard,
            ISynchronizationContextProvider synchronizationContextProvider,
            IOpenDocumentHelper openDocumentHelper,
            ITextDocumentTable textDocumentTable,
            IEventBus eventBus,
            IGlobalSettingsProvider globalSettingsProvider,
            IBuildOutputParser buildOutputParser,
            IVsEditorAdaptersFactoryService adaptersFactoryService,
            IShowServerInfoService showServerInfoService)
        {
            _control = control;
            _dispatchThreadServerRequestExecutor = dispatchThreadServerRequestExecutor;
            _fileSystemTreeSource      = fileSystemTreeSource;
            _typedRequestProcessProxy  = typedRequestProcessProxy;
            _progressBarTracker        = progressBarTracker;
            _standarImageSourceFactory = standarImageSourceFactory;
            _windowsExplorer           = windowsExplorer;
            _clipboard = clipboard;
            _synchronizationContextProvider = synchronizationContextProvider;
            _openDocumentHelper             = openDocumentHelper;
            _eventBus = eventBus;
            _globalSettingsProvider            = globalSettingsProvider;
            _buildOutputParser                 = buildOutputParser;
            _adaptersFactoryService            = adaptersFactoryService;
            _showServerInfoService             = showServerInfoService;
            _searchResultDocumentChangeTracker = new SearchResultsDocumentChangeTracker(
                dispatchThreadDelayedOperationExecutor,
                textDocumentTable);
            _taskCancellation = new TaskCancellation();

            // Ensure initial values are in sync.
            GlobalSettingsOnPropertyChanged(null, null);

            // Ensure changes to ViewModel are synchronized to global settings
            ViewModel.PropertyChanged += ViewModelOnPropertyChanged;

            // Ensure changes to global settings are synchronized to ViewModel
            _globalSettingsProvider.GlobalSettings.PropertyChanged += GlobalSettingsOnPropertyChanged;

            _eventBusCookie1 = _eventBus.RegisterHandler("TextDocument-Open", TextDocumentOpenHandler);
            _eventBusCookie2 = _eventBus.RegisterHandler("TextDocument-Closed", TextDocumentClosedHandler);
            _eventBusCookie3 = _eventBus.RegisterHandler("TextDocumentFile-FileActionOccurred", TextDocumentFileActionOccurred);

            typedRequestProcessProxy.EventReceived += TypedRequestProcessProxy_OnEventReceived;

            dispatchThreadServerRequestExecutor.ProcessFatalError += DispatchThreadServerRequestExecutor_OnProcessFatalError;

            fileSystemTreeSource.TreeReceived  += FileSystemTreeSource_OnTreeReceived;
            fileSystemTreeSource.ErrorReceived += FileSystemTreeSource_OnErrorReceived;
        }
예제 #5
0
        public OpenFileController(
            OpenFileControl control,
            IDispatchThreadServerRequestExecutor dispatchThreadServerRequestExecutor,
            IDispatchThreadDelayedOperationExecutor dispatchThreadDelayedOperationExecutor,
            IFileSystemTreeSource fileSystemTreeSource,
            ITypedRequestProcessProxy typedRequestProcessProxy,
            IStandarImageSourceFactory standarImageSourceFactory,
            IWindowsExplorer windowsExplorer,
            IClipboard clipboard,
            ISynchronizationContextProvider synchronizationContextProvider,
            IOpenDocumentHelper openDocumentHelper,
            ITextDocumentTable textDocumentTable,
            IDispatchThreadEventBus eventBus,
            IGlobalSettingsProvider globalSettingsProvider,
            IBuildOutputParser buildOutputParser,
            IVsEditorAdaptersFactoryService adaptersFactoryService,
            IShowServerInfoService showServerInfoService)
        {
            _control = control;
            _dispatchThreadServerRequestExecutor = dispatchThreadServerRequestExecutor;
            _fileSystemTreeSource      = fileSystemTreeSource;
            _typedRequestProcessProxy  = typedRequestProcessProxy;
            _standarImageSourceFactory = standarImageSourceFactory;
            _windowsExplorer           = windowsExplorer;
            _clipboard = clipboard;
            _synchronizationContextProvider = synchronizationContextProvider;
            _openDocumentHelper             = openDocumentHelper;
            _eventBus = eventBus;
            _globalSettingsProvider = globalSettingsProvider;
            _buildOutputParser      = buildOutputParser;
            _adaptersFactoryService = adaptersFactoryService;
            _showServerInfoService  = showServerInfoService;
            _taskCancellation       = new TaskCancellation();

            typedRequestProcessProxy.EventReceived += TypedRequestProcessProxy_OnEventReceived;

            dispatchThreadServerRequestExecutor.ProcessFatalError += DispatchThreadServerRequestExecutor_OnProcessFatalError;

            fileSystemTreeSource.TreeReceived  += FileSystemTreeSource_OnTreeReceived;
            fileSystemTreeSource.ErrorReceived += FileSystemTreeSource_OnErrorReceived;
        }
        /// <summary>
        /// Called when Visual Studio creates our container ToolWindow.
        /// </summary>
        public void OnVsToolWindowCreated(IServiceProvider serviceProvider)
        {
            var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));

            _uiRequestProcessor       = componentModel.DefaultExportProvider.GetExportedValue <IUIRequestProcessor>();
            _typedRequestProcessProxy = componentModel.DefaultExportProvider.GetExportedValue <ITypedRequestProcessProxy>();
            _fileSystemTreeSource     = componentModel.DefaultExportProvider.GetExportedValue <IFileSystemTreeSource>();

            _typedRequestProcessProxy.EventReceived += TypedRequestProcessProxy_EventReceived;
            _fileSystemTreeSource.TreeReceived      += FileSystemTreeSource_OnTreeReceived;
            _fileSystemTreeSource.ErrorReceived     += FileSystemTreeSource_OnErrorReceived;


            var standarImageSourceFactory = componentModel.DefaultExportProvider.GetExportedValue <IStandarImageSourceFactory>();

            _controller = new CodeSearchController(
                this,
                _uiRequestProcessor,
                componentModel.DefaultExportProvider.GetExportedValue <IUIDelayedOperationProcessor>(),
                _progressBarTracker,
                standarImageSourceFactory,
                componentModel.DefaultExportProvider.GetExportedValue <IWindowsExplorer>(),
                componentModel.DefaultExportProvider.GetExportedValue <IClipboard>(),
                componentModel.DefaultExportProvider.GetExportedValue <ISynchronizationContextProvider>(),
                componentModel.DefaultExportProvider.GetExportedValue <IOpenDocumentHelper>(),
                componentModel.DefaultExportProvider.GetExportedValue <ITextDocumentTable>(),
                componentModel.DefaultExportProvider.GetExportedValue <IEventBus>(),
                componentModel.DefaultExportProvider.GetExportedValue <IGlobalSettingsProvider>(),
                componentModel.DefaultExportProvider.GetExportedValue <IBuildOutputParser>(),
                componentModel.DefaultExportProvider.GetExportedValue <IVsEditorAdaptersFactoryService>());

            // TODO(rpaquay): leaky abstraction. We need this because the ViewModel
            // exposes pictures from Visual Studio resources.
            ViewModel.ImageSourceFactory = standarImageSourceFactory;

            _fileSystemTreeSource.Fetch();

            // Hookup property changed notifier
            ViewModel.PropertyChanged  += ViewModel_PropertyChanged;
            ViewModel.RootNodesChanged += ViewModelOnRootNodesChanged;
        }
예제 #7
0
 public SourceExplorerHierarchyController(
     ISynchronizationContextProvider synchronizationContextProvider,
     IFileSystemTreeSource fileSystemTreeSource,
     IVisualStudioPackageProvider visualStudioPackageProvider,
     IVsGlyphService vsGlyphService,
     IImageSourceFactory imageSourceFactory,
     IOpenDocumentHelper openDocumentHelper,
     IFileSystem fileSystem,
     IClipboard clipboard,
     IWindowsExplorer windowsExplorer,
     IDispatchThreadServerRequestExecutor dispatchThreadServerRequestExecutor,
     ITypedRequestProcessProxy typedRequestProcessProxy,
     IDispatchThreadEventBus eventBus,
     IGlobalSettingsProvider globalSettingsProvider,
     IDelayedOperationExecutor delayedOperationExecutor,
     IDispatchThread dispatchThread,
     IShowServerInfoService showServerInfoService)
 {
     _synchronizationContextProvider = synchronizationContextProvider;
     _fileSystemTreeSource           = fileSystemTreeSource;
     _visualStudioPackageProvider    = visualStudioPackageProvider;
     _imageSourceFactory             = imageSourceFactory;
     _openDocumentHelper             = openDocumentHelper;
     _fileSystem      = fileSystem;
     _clipboard       = clipboard;
     _windowsExplorer = windowsExplorer;
     _dispatchThreadServerRequestExecutor = dispatchThreadServerRequestExecutor;
     _eventBus = eventBus;
     _globalSettingsProvider   = globalSettingsProvider;
     _delayedOperationExecutor = delayedOperationExecutor;
     _showServerInfoService    = showServerInfoService;
     _nodeTemplateFactory      = new NodeTemplateFactory(vsGlyphService, imageSourceFactory);
     _nodeViewModelLoader      = new NodeViewModelLoader(typedRequestProcessProxy);
     _hierarchy = new VsHierarchyAggregate(
         visualStudioPackageProvider.Package.ServiceProvider,
         vsGlyphService,
         _imageSourceFactory,
         _nodeTemplateFactory,
         _nodeViewModelLoader,
         dispatchThread);
 }
예제 #8
0
    /// <summary>
    /// Called when Visual Studio creates our container ToolWindow.
    /// </summary>
    public void OnVsToolWindowCreated(IServiceProvider serviceProvider) {
      var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));

      _uiRequestProcessor = componentModel.DefaultExportProvider.GetExportedValue<IUIRequestProcessor>();
      _typedRequestProcessProxy = componentModel.DefaultExportProvider.GetExportedValue<ITypedRequestProcessProxy>();
      _fileSystemTreeSource = componentModel.DefaultExportProvider.GetExportedValue<IFileSystemTreeSource>();

      _typedRequestProcessProxy.EventReceived += TypedRequestProcessProxy_EventReceived;
      _fileSystemTreeSource.TreeReceived += FileSystemTreeSource_OnTreeReceived;
      _fileSystemTreeSource.ErrorReceived += FileSystemTreeSource_OnErrorReceived;


      var standarImageSourceFactory = componentModel.DefaultExportProvider.GetExportedValue<IStandarImageSourceFactory>();
      _controller = new CodeSearchController(
        this,
        _uiRequestProcessor,
        componentModel.DefaultExportProvider.GetExportedValue<IUIDelayedOperationProcessor>(),
        _progressBarTracker,
        standarImageSourceFactory,
        componentModel.DefaultExportProvider.GetExportedValue<IWindowsExplorer>(),
        componentModel.DefaultExportProvider.GetExportedValue<IClipboard>(),
        componentModel.DefaultExportProvider.GetExportedValue<ISynchronizationContextProvider>(),
        componentModel.DefaultExportProvider.GetExportedValue<IOpenDocumentHelper>(),
        componentModel.DefaultExportProvider.GetExportedValue<ITextDocumentTable>(),
        componentModel.DefaultExportProvider.GetExportedValue<IEventBus>(),
        componentModel.DefaultExportProvider.GetExportedValue<IGlobalSettingsProvider>(),
        componentModel.DefaultExportProvider.GetExportedValue<IBuildOutputParser>(),
        componentModel.DefaultExportProvider.GetExportedValue<IVsEditorAdaptersFactoryService>());

      // TODO(rpaquay): leaky abstraction. We need this because the ViewModel
      // exposes pictures from Visual Studio resources.
      ViewModel.ImageSourceFactory = standarImageSourceFactory;

      _fileSystemTreeSource.Fetch();

      // Hookup property changed notifier
      ViewModel.PropertyChanged += ViewModel_PropertyChanged;
      ViewModel.RootNodesChanged += ViewModelOnRootNodesChanged;
    }