/// <summary>
 /// Handles file watcher path error event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 protected override void OnFileWatcherPathError(object sender,
                                                FileWatcherPathErrorEventArgs e)
 {
     base.OnFileWatcherPathError(sender, e);
     // Set can stop all. Avoid deadlock if all file watchers have invalid path.
     _canStopAll.Set();
 }
Esempio n. 2
0
 /// <summary>
 /// Formats message.
 /// </summary>
 /// <param name="fileWatcherPathErrorEventArgs">Message.</param>
 /// <returns>Formatted message.</returns>
 /// <exception cref="ArgumentNullException">fileWatcherPathErrorEventArgs is null.</exception>
 public string Format(FileWatcherPathErrorEventArgs fileWatcherPathErrorEventArgs)
 {
     if (fileWatcherPathErrorEventArgs == null)
     {
         throw new ArgumentNullException("fileWatcherPathErrorEventArgs",
                                         Resources.ArgumentNullException);
     }
     return(String.Format(CultureInfo.CurrentCulture,
                          @Resources.MessageDaemonPathError,
                          @DateTime.Now,
                          @Resources.MessageTypeError,
                          fileWatcherPathErrorEventArgs.DaemonName,
                          fileWatcherPathErrorEventArgs.Path));
 }
Esempio n. 3
0
        /// <summary>
        /// Handles file watcher path 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 OnFileWatcherPathError(object sender,
                                                       FileWatcherPathErrorEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e",
                                                Resources.ArgumentNullException);
            }

            base.OnFileWatcherPathError(sender, e);
            _mainView.ShowFileWatcherPathErrorMessage(String.Format(CultureInfo.CurrentCulture,
                                                                    @Resources.MessageDaemonPathErrorWinForms,
                                                                    @e.DaemonName,
                                                                    @e.Path));
        }
Esempio n. 4
0
        /// <summary>
        /// Handles file watcher path 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 OnFileWatcherPathError(object sender,
                                                       FileWatcherPathErrorEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e",
                                                Resources.ArgumentNullException);
            }

            base.OnFileWatcherPathError(sender, e);
            _consoleView.EchoLine(String.Format(CultureInfo.InvariantCulture,
                                                Resources.MessageDaemonPathErrorConsole,
                                                e.DaemonName, e.Path));
            // Set can stop all. Avoid deadlock if all file watchers have invalid path.
            _canStopAll.Set();
        }
 /// <summary>
 /// Handles file watcher path error event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 protected virtual void OnFileWatcherPathError(object sender,
                                               FileWatcherPathErrorEventArgs e)
 {
     AddLogMessage(_formatter.Format(e));
 }
Esempio n. 6
0
 /// <summary>
 /// Handles file watcher path error event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 protected virtual void OnFileWatcherPathError(object sender,
                                               FileWatcherPathErrorEventArgs e)
 {
     _logger.Log(_formatter.Format(e));
 }