private void StartWorker() { log.Info("Scanning Monodoc sources"); Stopwatch timer = new Stopwatch(); timer.Start(); int foundSources = 0; int foundTypes = 0; DirectoryInfo root = new DirectoryInfo(monodoc_dir); if (Inotify.Enabled) { monodoc_wd = Inotify.Watch(root.FullName, Inotify.EventType.CloseWrite | Inotify.EventType.CreateFile); Inotify.Event += OnInotifyEvent; } else { FileSystemWatcher fsw = new FileSystemWatcher(); fsw.Path = monodoc_dir; fsw.Filter = "*.zip"; fsw.Changed += new FileSystemEventHandler(OnChangedEvent); fsw.Created += new FileSystemEventHandler(OnChangedEvent); fsw.EnableRaisingEvents = true; } foreach (FileInfo file in root.GetFiles("*.zip")) { int result = IndexArchive(file, Scheduler.Priority.Delayed); if (result != -1) { foundSources++; foundTypes += result; } } timer.Stop(); log.Info("Found {0} types in {1} Monodoc sources in {2}", foundTypes, foundSources, timer); }