Exemplo n.º 1
0
        public async Task OnLoadedAsync()
        {
            try {
                using (Log.CriticalOperation($"{nameof(OnLoadedAsync)}")) {
                    // ReSharper disable once PossibleNullReferenceException
                    await StartAsync?.InvokeAsync(this, EventArgs.Empty);

                    _hasStartedOnce = true;
                    Interlocked.Exchange(ref _state, 1);

                    if (_solutionEventListener == null)
                    {
                        var componentModel = ServiceProvider.GetService(typeof(SComponentModel)) as IComponentModel;
                        Assumes.Present(componentModel);

                        _solutionEventListener         = componentModel.GetService <ISolutionEventsListener>();
                        _solutionEventListener.Closed += SolutionOrFolder_Closed;
                        _solutionEventListener.Opened += SolutionOrFolder_Opened;
                        Log.Verbose($"set {nameof(_solutionEventListener)}");
                    }
                }
            }
            catch (Exception ex) {
                Log.Fatal(ex, nameof(OnLoadedAsync));
            }
        }
Exemplo n.º 2
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_testFilesUpdateWatcher != null)
                {
                    _testFilesUpdateWatcher.FileChangedEvent -= OnProjectItemChanged;
                    ((IDisposable)_testFilesUpdateWatcher).Dispose();
                    _testFilesUpdateWatcher = null;
                }

                if (_testFilesAddRemoveListener != null)
                {
                    _testFilesAddRemoveListener.TestFileChanged -= OnProjectItemChanged;
                    _testFilesAddRemoveListener.StopListeningForTestFileChanges();
                    _testFilesAddRemoveListener = null;
                }

                if (_solutionListener != null)
                {
                    _solutionListener.SolutionProjectChanged -= OnSolutionProjectChanged;
                    _solutionListener.StopListeningForChanges();
                    _solutionListener = null;
                }
            }
        }
        public PowerShellTestContainerDiscoverer(
            [Import(typeof (SVsServiceProvider))] IServiceProvider serviceProvider,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            _initialContainerSearch = true;
            _cachedContainers = new List<ITestContainer>();
            _serviceProvider = serviceProvider;
            _logger = logger;
            _solutionListener = solutionListener;
            _testFilesUpdateWatcher = testFilesUpdateWatcher;
            _testFilesAddRemoveListener = testFilesAddRemoveListener;

            logger.Log(MessageLevel.Diagnostic, "PowerShellTestContainerDiscoverer Constructor Entering");

            _testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            _testFilesAddRemoveListener.StartListeningForTestFileChanges();

            _solutionListener.SolutionUnloaded += SolutionListenerOnSolutionUnloaded;
            _solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            _solutionListener.StartListeningForChanges();

            _testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
        public ChutzpahTestContainerDiscoverer(IServiceProvider serviceProvider,
            IChutzpahSettingsMapper settingsMapper,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener,
            ITestRunner testRunner,
            IFileProbe fileProbe,
            IChutzpahTestSettingsService chutzpahTestSettingsService)
        {
            initialContainerSearch = true;
            cachedContainers = new ConcurrentDictionary<string, ITestContainer>(StringComparer.OrdinalIgnoreCase);
            this.serviceProvider = serviceProvider;
            this.settingsMapper = settingsMapper;
            this.logger = logger;
            this.testRunner = testRunner;
            this.fileProbe = fileProbe;
            this.chutzpahTestSettingsService = chutzpahTestSettingsService;
            this.solutionListener = solutionListener;
            this.testFilesUpdateWatcher = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;

            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded += SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
Exemplo n.º 5
0
        public ChutzpahTestContainerDiscoverer(IServiceProvider serviceProvider,
                                               IChutzpahSettingsMapper settingsMapper,
                                               ILogger logger,
                                               ISolutionEventsListener solutionListener,
                                               ITestFilesUpdateWatcher testFilesUpdateWatcher,
                                               ITestFileAddRemoveListener testFilesAddRemoveListener,
                                               ITestRunner testRunner,
                                               IFileProbe fileProbe,
                                               IChutzpahTestSettingsService chutzpahTestSettingsService)
        {
            initialContainerSearch           = true;
            cachedContainers                 = new ConcurrentDictionary <string, ITestContainer>(StringComparer.OrdinalIgnoreCase);
            this.serviceProvider             = serviceProvider;
            this.settingsMapper              = settingsMapper;
            this.logger                      = logger;
            this.testRunner                  = testRunner;
            this.fileProbe                   = fileProbe;
            this.chutzpahTestSettingsService = chutzpahTestSettingsService;
            this.solutionListener            = solutionListener;
            this.testFilesUpdateWatcher      = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener  = testFilesAddRemoveListener;

            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded       += SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
        public ChutzpahTestContainerDiscoverer(IServiceProvider serviceProvider,
            IChutzpahSettingsMapper settingsMapper,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener,
            ITestRunner testRunner,
            IFileProbe fileProbe)
        {
            initialContainerSearch = true;
            cachedContainers = new List<ITestContainer>();
            this.serviceProvider = serviceProvider;
            this.settingsMapper = settingsMapper;
            this.logger = logger;
            this.testRunner = testRunner;
            this.fileProbe = fileProbe;
            this.solutionListener = solutionListener;
            this.testFilesUpdateWatcher = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;

            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded += SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
        public PsateTestContainerDiscoverer(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            Trace.WriteLine("Hello");

            initialContainerSearch          = true;
            cachedContainers                = new List <ITestContainer>();
            this.serviceProvider            = serviceProvider;
            this.logger                     = logger;
            this.solutionListener           = solutionListener;
            this.testFilesUpdateWatcher     = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;


            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded       += SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
        public PsateTestContainerDiscoverer(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            Trace.WriteLine("Hello");
            
            initialContainerSearch = true;
            cachedContainers = new List<ITestContainer>();
            this.serviceProvider = serviceProvider;
            this.logger = logger;
            this.solutionListener = solutionListener;
            this.testFilesUpdateWatcher = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;


            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded += SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
Exemplo n.º 9
0
        public PowerShellTestContainerDiscoverer(
            ISolutionProvider solutionProvider,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            _initialContainerSearch = true;
            _cachedContainers       = new List <ITestContainer>();
            _solutionProvider       = solutionProvider;
            _logger                     = logger;
            _solutionListener           = solutionListener;
            _testFilesUpdateWatcher     = testFilesUpdateWatcher;
            _testFilesAddRemoveListener = testFilesAddRemoveListener;

            logger.Log(MessageLevel.Diagnostic, "PowerShellTestContainerDiscoverer Constructor Entering");

            _testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            _testFilesAddRemoveListener.StartListeningForTestFileChanges();

            _solutionListener.SolutionUnloaded       += SolutionListenerOnSolutionUnloaded;
            _solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            _solutionListener.StartListeningForChanges();

            _testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
Exemplo n.º 10
0
        public PluginConfiguration(IVisualStudioService visualStudioService, ISolutionEventsListener solutionEvents)
            : this()
        {
            this.visualStudioService = visualStudioService;
            this.solutionEvents = solutionEvents;
            this.solutionEvents.AfterSolutionLoaded += SolutionLoaded;
            this.solutionEvents.BeforeSolutionClosed += SolutionClosed;
            if (!visualStudioService.IsSolutionOpen)
                return;

            SetConfigFile();
            LoadConfig();
        }
Exemplo n.º 11
0
        public void Install(TinyIoCContainer container)
        {
            serviceProvider = container.Resolve<IServiceProvider>();

            menuCommandService = serviceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if (menuCommandService == null) return;
            pluginConfiguration = container.Resolve<IPluginConfiguration>();
            pluginConfiguration.PropertyChanged += SetButtonState;
            solutionEvents = container.Resolve<ISolutionEventsListener>();
            solutionEvents.AfterSolutionLoaded += SolutionLoaded;
            solutionEvents.BeforeSolutionClosed += SolutionClosed;
            var vs = container.Resolve<IVisualStudioService>();
            InstallMenuCommands(vs.IsSolutionOpen);
        }
Exemplo n.º 12
0
        public PluginConfiguration(IVisualStudioService visualStudioService, ISolutionEventsListener solutionEvents)
            : this()
        {
            this.visualStudioService = visualStudioService;
            this.solutionEvents      = solutionEvents;
            this.solutionEvents.AfterSolutionLoaded  += SolutionLoaded;
            this.solutionEvents.BeforeSolutionClosed += SolutionClosed;
            if (!visualStudioService.IsSolutionOpen)
            {
                return;
            }

            SetConfigFile();
            LoadConfig();
        }
 public ChutzpahTestContainerDiscoverer(
     [Import(typeof (SVsServiceProvider))] IServiceProvider serviceProvider,
     IChutzpahSettingsMapper settingsMapper,
     ISolutionEventsListener solutionListener,
     ITestFilesUpdateWatcher testFilesUpdateWatcher,
     ITestFileAddRemoveListener testFilesAddRemoveListener)
     : this(serviceProvider,
         settingsMapper,
         new Logger(serviceProvider),
         solutionListener,
         testFilesUpdateWatcher,
         testFilesAddRemoveListener,
         TestRunner.Create(),
         ChutzpahContainer.Get<IFileProbe>())
 {
 }
Exemplo n.º 14
0
        public QmlTestContainerDiscoverer(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            cachedContainers = new QmlTestContainerCache(
                this, serviceProvider, solutionListener, testFilesUpdateWatcher, testFilesAddRemoveListener);

            cachedContainers.CacheUpdated += (source, e) => {
                if (TestContainersUpdated != null)
                {
                    TestContainersUpdated(this, EventArgs.Empty);
                }
            };
        }
Exemplo n.º 15
0
        public void Install(TinyIoCContainer container)
        {
            serviceProvider = container.Resolve <IServiceProvider>();

            menuCommandService = serviceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if (menuCommandService == null)
            {
                return;
            }
            pluginConfiguration = container.Resolve <IPluginConfiguration>();
            pluginConfiguration.PropertyChanged += SetButtonState;
            solutionEvents = container.Resolve <ISolutionEventsListener>();
            solutionEvents.AfterSolutionLoaded  += SolutionLoaded;
            solutionEvents.BeforeSolutionClosed += SolutionClosed;
            var vs = container.Resolve <IVisualStudioService>();

            InstallMenuCommands(vs.IsSolutionOpen);
        }
Exemplo n.º 16
0
 public ChutzpahTestContainerDiscoverer(
     [Import(typeof(IServiceProvider))] IServiceProvider serviceProvider,
     IChutzpahSettingsMapper settingsMapper,
     ISolutionEventsListener solutionListener,
     ITestFilesUpdateWatcher testFilesUpdateWatcher,
     ITestFileAddRemoveListener testFilesAddRemoveListener)
     : this(
         serviceProvider,
         settingsMapper,
         new Logger(serviceProvider),
         solutionListener,
         testFilesUpdateWatcher,
         testFilesAddRemoveListener,
         TestRunner.Create(),
         ChutzpahContainer.Get <IFileProbe>(),
         ChutzpahContainer.Get <IChutzpahTestSettingsService>())
 {
 }
Exemplo n.º 17
0
        //public WebViewPackage() {
        //	OptionsDialogPage = GetDialogPage(typeof(OptionsDialogPage)) as OptionsDialogPage;
        //}

        //protected override int QueryClose(out bool pfCanClose)
        //{
        //    pfCanClose = true;
        //    // ReSharper disable once ConditionIsAlwaysTrueOrFalse
        //    if (pfCanClose)
        //    {
        //    }
        //    return VSConstants.S_OK;
        //}

        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        /// <param name="cancellationToken">A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down.</param>
        /// <param name="progress">A provider for progress updates.</param>
        /// <returns>A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method.</returns>
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            try {
                await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

                _componentModel = GetGlobalService(typeof(SComponentModel)) as IComponentModel;

                var settingsServiceFactory = _componentModel?.GetService <ISettingsServiceFactory>();
                _settingsManager = settingsServiceFactory.Create();
                if (_settingsManager != null)
                {
                    _settingsManager.DialogPage.PropertyChanged += DialogPage_PropertyChanged;
                }

                _solutionEventListener         = _componentModel.GetService <ISolutionEventsListener>();
                _solutionEventListener.Opened += SolutionOrFolder_Opened;
                _solutionEventListener.Closed += SolutionOrFolder_Closed;
                _solutionEventListener.Loaded += SolutionOrFolder_Loaded;

                _themeEventsService = _componentModel.GetService <IThemeEventsListener>();
                _themeEventsService.ThemeChangedEventHandler += Theme_Changed;

                AsyncPackageHelper.InitializeLogging(_settingsManager);
                AsyncPackageHelper.InitializePackage(GetType().Name);

                await base.InitializeAsync(cancellationToken, progress);

                var isSolutionLoaded = await IsSolutionLoadedAsync();

                Log.Debug($"{nameof(isSolutionLoaded)}={isSolutionLoaded}");
                if (isSolutionLoaded)
                {
                    await JoinableTaskFactory.RunAsync(VsTaskRunContext.UIThreadNormalPriority, () => {
                        return(AsyncPackageHelper.TryTriggerLspActivationAsync(Log));
                    });
                }

                Log.Debug($"{nameof(InitializeAsync)} completed");
            }
            catch (Exception ex) {
                Log.Fatal(ex, nameof(InitializeAsync));
            }
        }
Exemplo n.º 18
0
        //public WebViewPackage() {
        //	OptionsDialogPage = GetDialogPage(typeof(OptionsDialogPage)) as OptionsDialogPage;
        //}

        //protected override int QueryClose(out bool pfCanClose)
        //{
        //    pfCanClose = true;
        //    // ReSharper disable once ConditionIsAlwaysTrueOrFalse
        //    if (pfCanClose)
        //    {
        //    }
        //    return VSConstants.S_OK;
        //}

        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        /// <param name="cancellationToken">A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down.</param>
        /// <param name="progress">A provider for progress updates.</param>
        /// <returns>A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method.</returns>
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            try {
                _componentModel = await GetServiceAsync(typeof(SComponentModel)) as IComponentModel;

                Assumes.Present(_componentModel);

                await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

                _solutionEventListener         = _componentModel.GetService <ISolutionEventsListener>();
                _solutionEventListener.Opened += SolutionOrFolder_Opened;
                _solutionEventListener.Closed += SolutionOrFolder_Closed;
                _solutionEventListener.Loaded += SolutionOrFolder_Loaded;

                _themeEventsService = _componentModel.GetService <IThemeEventsListener>();
                _themeEventsService.ThemeChangedEventHandler += Theme_Changed;

                var manager = _componentModel.GetService <ISettingsServiceFactory>()?.GetOrCreate(nameof(WebViewPackage));
                if (manager != null)
                {
                    AsyncPackageHelper.InitializeLogging(manager.GetExtensionTraceLevel());
                }

                AsyncPackageHelper.InitializePackage(GetType().Name);

                await base.InitializeAsync(cancellationToken, progress);

                var isSolutionLoaded = await IsSolutionLoadedAsync();

                Log.Debug($"{nameof(isSolutionLoaded)}={isSolutionLoaded}");
                if (isSolutionLoaded)
                {
                    await JoinableTaskFactory.RunAsync(VsTaskRunContext.UIThreadNormalPriority,
                                                       () => AsyncPackageHelper.TryTriggerLspActivationAsync(Log));
                }

                Log.Debug($"{nameof(WebViewPackage)} {nameof(InitializeAsync)} completed");
            }
            catch (Exception ex) {
                Log.Fatal(ex, nameof(InitializeAsync));
            }
        }
        public QmlTestContainerCache(
            ITestContainerDiscoverer testContainerDiscoverer,
            IServiceProvider serviceProvider,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            this.solutionListener           = solutionListener;
            this.serviceProvider            = serviceProvider;
            this.testFilesUpdateWatcher     = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;
            this.testContainerDiscoverer    = testContainerDiscoverer;

            this.solutionListener.SolutionUnloaded          += OnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged    += OnSolutionProjectChanged;
            this.testFilesUpdateWatcher.FileChangedEvent    += OnProjectItemChanged;
            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;

            this.solutionListener.StartListeningForChanges();
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();
        }
Exemplo n.º 20
0
        public CucumberJsTestContainerDiscoverer(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            this.initialContainerSearch     = true;
            this.cachedContainers           = new ConcurrentDictionary <string, ITestContainer>(StringComparer.OrdinalIgnoreCase);
            this.serviceProvider            = serviceProvider;
            this.solutionListener           = solutionListener;
            this.testFilesUpdateWatcher     = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;

            this.testFilesAddRemoveListener.TestFileChanged += this.OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded       += this.SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += this.OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += this.OnProjectItemChanged;
        }
        public CucumberJsTestContainerDiscoverer(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            this.initialContainerSearch = true;
            this.cachedContainers = new ConcurrentDictionary<string, ITestContainer>(StringComparer.OrdinalIgnoreCase);
            this.serviceProvider = serviceProvider;
            this.solutionListener = solutionListener;
            this.testFilesUpdateWatcher = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;

            this.testFilesAddRemoveListener.TestFileChanged += this.OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded += this.SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += this.OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += this.OnProjectItemChanged;
        }
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (testFilesUpdateWatcher != null)
                {
                    testFilesUpdateWatcher.FileChangedEvent -= OnProjectItemChanged;
                    ((IDisposable)testFilesUpdateWatcher).Dispose();
                    testFilesUpdateWatcher = null;
                }

                if (testFilesAddRemoveListener != null)
                {
                    testFilesAddRemoveListener.TestFileChanged -= OnProjectItemChanged;
                    testFilesAddRemoveListener.StopListeningForTestFileChanges();
                    testFilesAddRemoveListener = null;
                }

                if (solutionListener != null)
                {
                    solutionListener.SolutionProjectChanged -= OnSolutionProjectChanged;
                    solutionListener.StopListeningForChanges();
                    solutionListener = null;
                }
            }
        }