/// <summary> /// Enables or disables controls. /// </summary> private void UpdateControls() { _mainView.StartEnabled = false; _mainView.StopEnabled = false; _mainView.DeleteEnabled = false; _mainView.PropertiesEnabled = false; _mainView.StartAllEnabled = FileWatcherController.CanStartAllFileWatchers(); _mainView.StopAllEnabled = FileWatcherController.CanStopAllFileWatchers(); _mainView.NewEnabled = FileWatcherController.CanAddFileWatcherConfiguration(); _mainView.ExitEnabled = !FileWatcherController.IsActive(); }
/// <summary> /// Enables or disables controls. /// </summary> /// <param name="selectedDaemon">Selected daemon name.</param> private void UpdateControls(string selectedDaemon) { _mainView.StartEnabled = FileWatcherController.CanStartFileWatcher(selectedDaemon); _mainView.StopEnabled = FileWatcherController.CanStopFileWatcher(selectedDaemon); _mainView.StartAllEnabled = FileWatcherController.CanStartAllFileWatchers(); _mainView.StopAllEnabled = FileWatcherController.CanStopAllFileWatchers(); _mainView.NewEnabled = FileWatcherController.CanAddFileWatcherConfiguration(); bool canEdit = FileWatcherController.CanEditFileWatcherConfiguration(); _mainView.DeleteEnabled = canEdit; _mainView.PropertiesEnabled = canEdit; _mainView.ExitEnabled = !FileWatcherController.IsActive(); }