private static void RunWithWriterAndSensor <TheSensor, TheWriter>() where TheSensor : ISensor, new() where TheWriter : ITemperatureWriter, new() { Log.Instance.Write("Get Started"); CronRunner <TemperatureJob <TheSensor, TheWriter> > .Run(Config.Instance.CronJob).GetAwaiter().GetResult(); }
private static void RunWithWriter <TheWriter>() where TheWriter : ITemperatureWriter, new() { switch (Config.Instance.Device) { case "SenseHat": CronRunner <TemperatureJob <SenseHatWrapper, TheWriter> > .Run(Config.Instance.CronJob).GetAwaiter().GetResult(); SenseHatWrapper CreateInstanceToClearDisplay; break; case "BME280": CronRunner <TemperatureJob <BME280Wrapper, TheWriter> > .Run(Config.Instance.CronJob).GetAwaiter().GetResult(); break; case "Mock": CronRunner <TemperatureJob <MockSensor, TheWriter> > .Run(Config.Instance.CronJob).GetAwaiter().GetResult(); break; default: break; } }
static void Main(string[] args) { CronRunner <HelloJob> .Run("0/5 0/1 8-23 * * ?").GetAwaiter().GetResult(); }