Ejemplo n.º 1
0
        /// <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();
        }
Ejemplo n.º 2
0
        /// <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();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Runs the application.
 /// </summary>
 private void RunApplication()
 {
     base.WriteApplicationStartedMessage();
     if (FileWatcherController.CanStartAllFileWatchers())
     {
         StartAllFileWatchers();
         _consoleView.EchoReadLine(String.Empty);
         StopAllFileWatchers();
         WaitForControllerStopped();
     }
     else
     {
         _consoleView.EchoLine(@Resources.MessageNoDaemonsToStart);
         _consoleView.EchoReadLine(@Resources.MessagePressEnterToExit);
     }
     base.WriteApplicationStoppedMessage();
     Dispose();
 }