/// <summary> /// Handles file watcher search process 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 virtual void OnFileWatcherSearchProgress(object sender, FileWatcherSearchProgressEventArgs e) { if (e == null) { throw new ArgumentNullException("e", Resources.ArgumentNullException); } if (e.LogEvent) { AddLogMessage(_formatter.Format(e)); } }
/// <summary> /// Formats message. /// </summary> /// <param name="fileWatcherSearchProgressEventArgs">Message.</param> /// <returns>Formatted message.</returns> /// <exception cref="ArgumentNullException">fileWatcherSearchProgressEventArgs is null.</exception> public string Format(FileWatcherSearchProgressEventArgs fileWatcherSearchProgressEventArgs) { if (fileWatcherSearchProgressEventArgs == null) { throw new ArgumentNullException("fileWatcherSearchProgressEventArgs", Resources.ArgumentNullException); } return(String.Format(CultureInfo.CurrentCulture, @Resources.MessageSearchProgess, @DateTime.Now, @Resources.MessageTypeInfo, @fileWatcherSearchProgressEventArgs.DaemonName, @fileWatcherSearchProgressEventArgs.DirectoryFullPath)); }
/// <summary> /// Handles file watcher search process 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 OnFileWatcherSearchProgress(object sender, FileWatcherSearchProgressEventArgs e) { if (e == null) { throw new ArgumentNullException("e", Resources.ArgumentNullException); } base.OnFileWatcherSearchProgress(sender, e); if (e.DisplayEvent) { _consoleView.EchoLine(String.Format(CultureInfo.InvariantCulture, Resources.MessageSearchProgress, e.DirectoryFullPath)); } }