Exemplo n.º 1
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));
 }
Exemplo n.º 2
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);
            IncreaseErrorCount(e.DaemonName);
            UpdateList(false);
        }
Exemplo n.º 3
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)
 {
     AddLogMessage(_formatter.Format(e));
 }
Exemplo n.º 4
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);
 }
Exemplo n.º 5
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));
        }
Exemplo n.º 6
0
 /// <summary>
 /// Handles buffer error event. Runs in the main thread.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 private void OnBufferError(object sender,
                            FileWatcherBufferErrorEventArgs e)
 {
     EventHandler<FileWatcherBufferErrorEventArgs> handler = BufferError;
     if (handler != null)
     {
         handler(this, e);
     }
 }