public AutomationEventTuple GetAutomationEventFrom (object provider, int id) { foreach (AutomationEventTuple tuple in AutomationEvents) if (tuple.provider == provider && tuple.eventId.Id == id) return tuple; return null; }