/// <summary>
 /// Handles file watcher searcher error.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 /// <exception cref="ArgumentNullException">e is null.</exception>
 protected virtual void OnFileWatcherSearchError(object sender,
     FileWatcherSearchErrorEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e",
                                         Resources.ArgumentNullException);
     }
     if (e.LogEvent)
     {
         _logger.Log(_formatter.Format(e));
     }
 }
        /// <summary>
        /// Handles file watcher searcher error.
        /// </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 OnFileWatcherSearchError(object sender,
            FileWatcherSearchErrorEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e",
                                                Resources.ArgumentNullException);
            }

            base.OnFileWatcherSearchError(sender, e);
            IncreaseErrorCount(e.DaemonName);
            UpdateList(false);
        }
        /// <summary>
        /// Handles file watcher searcher error.
        /// </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 OnFileWatcherSearchError(object sender, 
            FileWatcherSearchErrorEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e",
                                                Resources.ArgumentNullException);
            }

            base.OnFileWatcherSearchError(sender, e);
            if (e.DisplayEvent)
            {
                _consoleView.EchoLine(String.Format(CultureInfo.InvariantCulture,
                                                   @Resources.MessageSearchError,
                                                   @e.Exception.Message));
            }
        }
Beispiel #4
0
 /// <summary>
 /// Formats message.
 /// </summary>
 /// <param name="fileWatcherSearchErrorEventArgs">Message.</param>
 /// <returns>Formatted message.</returns>
 /// <exception cref="ArgumentNullException">fileWatcherSearchErrorEventArgs is null.</exception>
 public string Format(FileWatcherSearchErrorEventArgs fileWatcherSearchErrorEventArgs)
 {
     if (fileWatcherSearchErrorEventArgs == null)
     {
         throw new ArgumentNullException("fileWatcherSearchErrorEventArgs",
                                         Resources.ArgumentNullException);
     }
     return String.Format(CultureInfo.CurrentCulture,
                          @Resources.MessageSearchError,
                          @DateTime.Now,
                          @Resources.MessageTypeError,
                          @fileWatcherSearchErrorEventArgs.DaemonName,
                          @fileWatcherSearchErrorEventArgs.Exception.Message);
 }
 /// <summary>
 /// Handles file watcher file search error event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 private void OnFileWatcherSearchError(object sender,
                                       FileWatcherSearchErrorEventArgs e)
 {
     EventHandler<FileWatcherSearchErrorEventArgs> handler = FileWatcherSearchError;
     if (handler != null)
     {
         handler(this, e);
     }
 }