コード例 #1
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));
 }
コード例 #2
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));
        }
コード例 #3
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);
 }
コード例 #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>
 protected virtual void OnFileWatcherPathError(object sender,
     FileWatcherPathErrorEventArgs e)
 {
     AddLogMessage(_formatter.Format(e));
 }
コード例 #5
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();
        }