|
using System;
using System.Collections.Generic;
using System.Net.Mail;
using JetBrains.Annotations;
using Kaleida.ServiceMonitor.Model.Runtime;
using Kaleida.ServiceMonitor.Framework;
namespace Kaleida.ServiceMonitor.Model.ScriptDirectives
{
public class EmailSummaryDirective : IScriptDirective
{
private readonly IList<MailAddress> recipientEmails;
private readonly IList<ScheduledTime> timesOfDay;
public EmailSummaryDirective([NotNull] string recipients, [NotNull] string time)
{
if (recipients == null) throw new ArgumentNullException("recipients");
if (time == null) throw new ArgumentNullException("time");
recipientEmails = recipients.ToMailAddressList();
timesOfDay = time.ToScheduledTimeList();
}
public void Apply([NotNull] CompiledScript script)
{
if (script == null) throw new ArgumentNullException("script");
script.EmailSummarySchedule = new EmailSummarySchedule(recipientEmails, timesOfDay);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Stuart Wheelwright is the Principal Architect and Software Developer at
BlackJet Software Ltd.
He has over 16 years commercial experience producing robust, maintainable, web-based solutions and bespoke systems for Microsoft platforms.
His latest project is
Shopping UK, an elegantly simple shopping list for iPhone.