23 using System.Collections.Generic;
24 using System.Globalization;
33 namespace Ntp.Analyzer.Process.Description
47 this.configFile = configFile;
48 jobs =
new List<Job>();
54 client.Credentials =
new NetworkCredential(config.
SmtpUser, config.
SmtpPass ??
string.Empty);
63 private readonly List<Job>
jobs;
64 private readonly
int pid;
68 public override string JobType =>
"Notification mail";
70 public override int Priority => 99;
74 var message =
new MailMessage(
99 var builder =
new StringBuilder();
100 builder.AppendLine(
"List of running items in NTP Analyzer");
102 builder.Append(
"Using configuration: ");
103 builder.AppendLine(configFile);
104 builder.Append(
"Running with PID: ");
105 builder.AppendLine(pid.ToString(CultureInfo.InvariantCulture));
106 return builder.ToString();
109 #region IDisposable Support 127 GC.SuppressFinalize(
this);
readonly NotifyConfiguration config
string BuildContent()
Builds the message content.
readonly SmtpClient client
static string Jobs(IEnumerable< Job > jobs)
NotifyJob(NotifyConfiguration config, LogBase log, int pid, string configFile)
Base class for jobs following the GoF Command Pattern.
override void InternalExecute()
Implementing method for descendants.
readonly string configFile
void Dispose(bool disposing)
void SetJobList(IEnumerable< Job > items)
Sets the job list to be monitored.
readonly List< Job > jobs