|
using System;
namespace Schedule
{
public class ReportEventArgs : EventArgs
{
public ReportEventArgs(DateTime Time, int reportNo) { EventTime = Time; ReportNo = reportNo; }
public int ReportNo;
public DateTime EventTime;
}
public delegate void ReportEventHandler(object sender, ReportEventArgs e);
/// <summary>
/// Summary description for ReportTimer.
/// </summary>
public class ReportTimer : ScheduleTimerBase
{
public void AddReportEvent(IScheduledItem Schedule, int reportNo)
{
if (Elapsed == null)
throw new Exception("You must set elapsed before adding Events");
AddJob(new TimerJob(Schedule, new DelegateMethodCall(Handler, Elapsed, reportNo)));
}
public void AddAsyncReportEvent(IScheduledItem Schedule, int reportNo)
{
if (Elapsed == null)
throw new Exception("You must set elapsed before adding Events");
TimerJob Event = new TimerJob(Schedule, new DelegateMethodCall(Handler, Elapsed, reportNo));
Event.SyncronizedEvent = false;
AddJob(Event);
}
public event ReportEventHandler Elapsed;
delegate void ConvertHandler(ReportEventHandler Handler, int ReportNo, object sender, DateTime time);
static ConvertHandler Handler = new ConvertHandler(Converter);
static void Converter(ReportEventHandler Handler, int ReportNo, object sender, DateTime time)
{
if (Handler == null)
throw new ArgumentNullException("Handler");
if (sender == null)
throw new ArgumentNullException("sender");
Handler(sender, new ReportEventArgs(time, ReportNo));
}
}
}
|
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.
I co-founded Standard Beagle Studio, a software development consulting service in Austin Texas with my wife Cindy Brummer. We focus mostly on web projects, but have built some react native mobile apps, and even a windows screen saver or two.
I started my career back when ASP pages were state of the art, and IE3 was considered a web browser. I've worked with Microsoft technologies for most of that time, and have recently branched out into node, wordpress, and react native applications.
I'm a web developer, math and physics enthusiast, father of 2, and all around great guy. I live in Austin TX and love using technology to change people's lives for the better. When I manage scrape together some spare time, I build generative art at curvature of the mind.