private async Task StartAsync() { this.solutionMonitor = new SolutionMonitor(this.package); this.importMonitor = new ImportsMonitor(this.solutionMonitor); this.hierarchyNodeManager = new ImportsHierarchyNodeManager(this.package, this.importMonitor, this.solutionMonitor); this.changeMonitor = new LastWriteFileChangeMonitor(this.package, this.importMonitor); this.changeMonitor.FileChanged += this.ChangeMonitor_FileChanged; await this.changeMonitor.InitializeAsync(); await this.solutionMonitor.InitializeAsync(); this.solutionMonitor.Start(); Trace.TraceInformation("ImportWatcher Started"); }
private void Stop() { if (this.changeMonitor != null) { this.changeMonitor.FileChanged -= this.ChangeMonitor_FileChanged; } this.changeMonitor?.Dispose(); this.hierarchyNodeManager?.Dispose(); this.importMonitor?.Dispose(); this.solutionMonitor?.Dispose(); this.changeMonitor = null; this.hierarchyNodeManager = null; this.importMonitor = null; this.solutionMonitor = null; Trace.TraceInformation("ImportWatcher Stopped"); }