public Automation GetAutomation(AutomationType type) { for (int i = 0, j = Automations.Count; i < j; i++) { var automation = Automations[i]; if (automation.Type == type) { return automation; } } return null; }