Exemplo n.º 1
0
 /// <summary>
 /// Handles file watcher started event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 protected virtual void OnFileWatcherStarted(object sender,
     FileWatcherStartedEventArgs e)
 {
     _logger.Log(_formatter.Format(e));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Handles file watcher started event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">Event data.</param>
        /// <exception cref="ArgumentNullException">e is null.</exception>
        protected override void OnFileWatcherStarted(object sender,
            FileWatcherStartedEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e",
                                                Resources.ArgumentNullException);
            }

            base.OnFileWatcherStarted(sender, e);
            SetStartedState(e.DaemonName);
            UpdateList(false);
            UpdateRunningFileWatchers();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Handles file watcher started event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 protected virtual void OnFileWatcherStarted(object sender,
     FileWatcherStartedEventArgs e)
 {
     AddLogMessage(_formatter.Format(e));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Formats message.
 /// </summary>
 /// <param name="fileWatcherStartedEventArgs">Message.</param>
 /// <returns>Formatted message.</returns>
 /// <exception cref="ArgumentNullException">fileWatcherStartedEventArgs is null.</exception>
 public string Format(FileWatcherStartedEventArgs fileWatcherStartedEventArgs)
 {
     if (fileWatcherStartedEventArgs == null)
     {
         throw new ArgumentNullException("fileWatcherStartedEventArgs",
                                         Resources.ArgumentNullException);
     }
     return String.Format(CultureInfo.CurrentCulture,
                          @Resources.MessageDaemonStarted,
                          @DateTime.Now,
                          @Resources.MessageTypeInfo,
                          @fileWatcherStartedEventArgs.DaemonName);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Handles file watcher started event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">Event data.</param>
        /// <exception cref="ArgumentNullException">e is null.</exception>
        protected override void OnFileWatcherStarted(object sender,
            FileWatcherStartedEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e",
                                                Resources.ArgumentNullException);
            }

            base.OnFileWatcherStarted(sender, e);
            _consoleView.EchoLine(String.Format(CultureInfo.CurrentCulture,
                                               @Resources.MessageDaemonStarted,
                                               @e.DaemonName));
            // Set can stop all.
            _canStopAll.Set();
        }
Exemplo n.º 6
0
 /// <summary>
 /// Handles file watcher started event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 private void OnFileWatcherStarted(object sender,
                                   FileWatcherStartedEventArgs e)
 {
     EventHandler<FileWatcherStartedEventArgs> handler = FileWatcherStarted;
     if (handler != null)
     {
         handler(this, e);
     }
 }