public void StartWatcher() { QuickScanStartupArgs args = new QuickScanStartupArgs(); try { this.config = ConfigManager.getConfig(); watcher = new FileSystemWatcher(); watcher.Path = config.watchPath; watcher.Filter = "*.*"; //watch for any file and filter at the event watcher.Created += new FileSystemEventHandler(OnFileCreated); // Begin watching. watcher.EnableRaisingEvents = true; } catch (Exception ex) { watcher.EnableRaisingEvents = false; args.Success = false; args.Message = "Starting the file system watcher failed : " + ex.Message; OnQuickScanStartup(args); } }
protected virtual void OnQuickScanStartup(QuickScanStartupArgs e) { }