public void Start(AutomationConfig config) { foreach (var triggerConfig in config.Triggers) { foreach (var eventConfig in triggerConfig.Events) { Log.Information("Subscribing event {Event}", eventConfig); SubscribeEvent(eventConfig, () => { Log.Information("Handling event {Event}", eventConfig); if (triggerConfig.IsActive) { CallTrigger(triggerConfig); } }); } } }
private static AutomationConfig LoadAutomationConfig(string filePath) { var document = XDocument.Load(filePath); return(AutomationConfig.FromXml(document.Root)); }
public void OneTimeSetUp() { Config = AutomationConfig.DeserializeConfig("AutomationSettings.json"); }
public AutomationConfig LoadAutomationConfig(string fileName) => LoadConfig(fileName, element => AutomationConfig.FromXml(element));