Exemplo n.º 1
0
 /// <summary>
 /// Handles process canceled event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 protected virtual void OnProcessCanceled(object sender,
     ProcessCanceledEventArgs e)
 {
     _logger.Log(_formatter.Format(e));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Handles process canceled event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 protected virtual void OnProcessCanceled(object sender,
     ProcessCanceledEventArgs e)
 {
     AddLogMessage(_formatter.Format(e));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Handles process canceled 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 OnProcessCanceled(object sender,
            ProcessCanceledEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e",
                                                Resources.ArgumentNullException);
            }

            base.OnProcessCanceled(sender, e);
            UpdateProcessesToRun(e.QueuedProcesses);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Formats message.
 /// </summary>
 /// <param name="processCanceledEventArgs">Message.</param>
 /// <returns>Formatted message.</returns>
 /// <exception cref="ArgumentNullException">processCanceledEventArgs is null.</exception>
 public string Format(ProcessCanceledEventArgs processCanceledEventArgs)
 {
     if (processCanceledEventArgs == null)
     {
         throw new ArgumentNullException("processCanceledEventArgs",
                                         Resources.ArgumentNullException);
     }
     if (processCanceledEventArgs.Reason == ProcessCanceledReason.FileWasMissing)
     {
         return String.Format(CultureInfo.CurrentCulture,
                              @Resources.MessageProcessCanceled,
                              @DateTime.Now,
                              @Resources.MessageTypeWarn,
                              @processCanceledEventArgs.DaemonName,
                              @Resources.MessageProcessCanceledReasonFileIsMissing,
                              @processCanceledEventArgs.FullPath);
     }
     if (processCanceledEventArgs.Reason == ProcessCanceledReason.FileLockTestFailed)
     {
         return String.Format(CultureInfo.CurrentCulture,
                              @Resources.MessageProcessCanceled,
                              @DateTime.Now,
                              @Resources.MessageTypeWarn,
                              @processCanceledEventArgs.DaemonName,
                              @Resources.MessageProcessCanceledReasonFileLockTestFailed,
                              @processCanceledEventArgs.FullPath);
     }
     return String.Format(CultureInfo.CurrentCulture,
                          @Resources.MessageProcessCanceled,
                          @DateTime.Now,
                          @Resources.MessageTypeWarn,
                          @processCanceledEventArgs.DaemonName,
                          @Resources.MessageProcessCanceledReasonRenameFailed,
                          @processCanceledEventArgs.FullPath);
 }