예제 #1
0
 /// <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)
     {
         _logger.Log(_formatter.Format(e));
     }
 }
예제 #2
0
        /// <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));
            }
        }
예제 #3
0
 /// <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);
 }
예제 #4
0
 /// <summary>
 /// Handles file watcher file search progress event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 private void OnFileWatcherSearchProgress(object sender,
                                          FileWatcherSearchProgressEventArgs e)
 {
     EventHandler<FileWatcherSearchProgressEventArgs> handler = FileWatcherSearchProgress;
     if (handler != null)
     {
         handler(this, e);
     }
 }