protected void DisposeProjectAndFileTrackers() { if (fileTracker != null) { fileTracker.Dispose(); fileTracker = null; } if (projectTracker != null) { projectTracker.Dispose(); projectTracker = null; } }
protected void InitializeProjectAndFileTrackers() { DisposeProjectAndFileTrackers(); // Subscribe to Project events projectTracker = new ProjectDocumentsListener(this.ServiceProvider); projectTracker.FileAdded += projectTracker_FileAdded; projectTracker.FileRenamed += projectTracker_FileRenamed; projectTracker.FileRemoved += projectTracker_FileRemoved; projectTracker.Initialize(); // Each file encountered during the crawl will be separately tracked for future changes. fileTracker = new FileChangeListener(this.ServiceProvider); fileTracker.OnFilesChanged += fileTracker_OnFilesChanged; }