/// <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)); }
/// <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); }
/// <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)); }
/// <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); }
/// <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. 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); } }