/// <summary>
        /// Handles buffer error 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 OnBufferError(object sender,
                                              FileWatcherBufferErrorEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e",
                                                Resources.ArgumentNullException);
            }

            base.OnBufferError(sender, e);
            IncreaseErrorCount(e.DaemonName);
            UpdateList(false);
        }
Exemple #2
0
 /// <summary>
 /// Formats message.
 /// </summary>
 /// <param name="fileWatcherBufferErrorEventArgs">Message.</param>
 /// <returns>Formatted message.</returns>
 /// <exception cref="ArgumentNullException">fileWatcherBufferErrorEventArgs is null.</exception>
 public string Format(FileWatcherBufferErrorEventArgs fileWatcherBufferErrorEventArgs)
 {
     if (fileWatcherBufferErrorEventArgs == null)
     {
         throw new ArgumentNullException("fileWatcherBufferErrorEventArgs",
                                         Resources.ArgumentNullException);
     }
     return(String.Format(CultureInfo.CurrentCulture,
                          @Resources.MessageBufferError,
                          @DateTime.Now,
                          @Resources.MessageTypeError,
                          @fileWatcherBufferErrorEventArgs.DaemonName,
                          @fileWatcherBufferErrorEventArgs.ErrorEventArgs.GetException().Message));
 }
Exemple #3
0
        /// <summary>
        /// Handles buffer error 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 OnBufferError(object sender,
                                              FileWatcherBufferErrorEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e",
                                                Resources.ArgumentNullException);
            }

            base.OnBufferError(sender, e);
            _consoleView.EchoLine(String.Format(CultureInfo.CurrentCulture,
                                                @Resources.MessageBufferError,
                                                e.DaemonName,
                                                e.ErrorEventArgs.GetException().Message));
        }
 /// <summary>
 /// Handles buffer error event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 protected virtual void OnBufferError(object sender,
                                      FileWatcherBufferErrorEventArgs e)
 {
     AddLogMessage(_formatter.Format(e));
 }
Exemple #5
0
 /// <summary>
 /// Handles buffer error event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 protected virtual void OnBufferError(object sender,
                                      FileWatcherBufferErrorEventArgs e)
 {
     _logger.Log(_formatter.Format(e));
 }