Ejemplo n.º 1
0
        private TestContainerDiscovererProject(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            [Import(typeof(IOperationState))] IOperationState operationState,
            [Import] IPythonWorkspaceContextProvider workspaceContextProvider,
            [Import] IInterpreterOptionsService interpreterOptionsService
            )
        {
            _serviceProvider          = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
            _workspaceContextProvider = workspaceContextProvider ?? throw new ArgumentNullException(nameof(workspaceContextProvider));
            _projectMap = new ConcurrentDictionary <string, ProjectInfo>();
            _packageManagerEventSink = new PackageManagerEventSink(interpreterOptionsService);
            _packageManagerEventSink.InstalledPackagesChanged += OnInstalledPackagesChanged;
            _firstLoad     = true;
            _isRefresh     = false;
            _setupComplete = false;
            _deferredTestChangeNotification = new Timer(OnDeferredTestChanged);

            _solutionListener = new SolutionEventsListener(_serviceProvider);
            _solutionListener.ProjectLoaded    += OnProjectLoaded;
            _solutionListener.ProjectUnloading += OnProjectUnloaded;
            _solutionListener.ProjectClosing   += OnProjectUnloaded;
            _solutionListener.SolutionOpened   += OnSolutionLoaded;
            _solutionListener.SolutionClosed   += OnSolutionClosed;
            _solutionListener.StartListeningForChanges();

            _testFilesAddRemoveListener = new TestFileAddRemoveListener(_serviceProvider, new Guid());
            _testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            _testFilesAddRemoveListener.StartListeningForTestFileChanges();
        }
 private TestContainerDiscovererWorkspace(
     [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
     [Import(typeof(IOperationState))] IOperationState operationState,
     [Import] IPythonWorkspaceContextProvider workspaceContextProvider,
     [Import] IInterpreterOptionsService interpreterOptionsService,
     [Import] IInterpreterRegistryService interpreterRegistryService
     )
 {
     _serviceProvider         = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     _projectMap              = new ConcurrentDictionary <string, ProjectInfo>();
     _packageManagerEventSink = new PackageManagerEventSink(interpreterOptionsService);
     _packageManagerEventSink.InstalledPackagesChanged += OnInstalledPackagesChanged;
     _interpreterRegistryService     = interpreterRegistryService;
     _deferredTestChangeNotification = new Timer(OnDeferredTestChanged);
     _firstLoad = true;
     _isRefresh = false;
     _workspaceContextProvider = workspaceContextProvider ?? throw new ArgumentNullException(nameof(workspaceContextProvider));
     _workspaceContextProvider.WorkspaceClosed      += OnWorkspaceClosed;
     _workspaceContextProvider.WorkspaceInitialized += OnWorkspaceLoaded;
 }