public int GetAutomationEventCount (AutomationEvent eventId) { int count = 0; foreach (AutomationEventTuple evnt in AutomationEvents) { if (evnt.eventId.Id == eventId.Id) count++; } return count; }