private void ForceDetect() { if (_lastForceDetect.Add(Constants.FORCE_DETECT_PERIOD) > DateTime.UtcNow) { return; } var count = FilesCount; var firstTimeDetect = _firstTimeDetect; if (_firstTimeDetect) { UpdateStatus("Searching files..."); TaskbarProgress.SetState(TaskbarStates.Indeterminate); _firstTimeDetect = false; } FilesMonitor.ForceProcess(); var actualCount = FilesCount; if (actualCount != count || firstTimeDetect) { UpdateStatus($"Monitoring {actualCount} files..."); } _lastForceDetect = DateTime.UtcNow; }
private void AddFile(string pathMask) { FilesMonitor.Add(pathMask, Configs.Follow, this); UpdateStatus($"Added {pathMask}"); }