コード例 #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 override void OnFileWatcherStarted(object sender,
                                              FileWatcherStartedEventArgs e)
 {
     base.OnFileWatcherStarted(sender, e);
     // Set can stop all.
     _canStopAll.Set();
 }
コード例 #2
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));
 }
コード例 #3
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();
        }
コード例 #4
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();
        }
コード例 #5
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));
 }
コード例 #6
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));
 }
コード例 #7
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));
 }
コード例 #8
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();
        }
コード例 #9
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));
 }
コード例 #10
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);
 }
コード例 #11
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();
        }
コード例 #12
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);
     }
 }