public int WatchEvent <T1, T2>(EventCode eventCode, Action <T1, T2> action) { if (!eventHandlerList.ContainsKey(eventCode.EventID)) { var newList = new List <Delegate>(); eventHandlerList.Add(eventCode.EventID, newList); } var list = eventHandlerList[eventCode.EventID]; var handlerId = TallyEventHandlerCounter.GetEventHandlerId(); list.Add(action); return(handlerId); }
public EventHandler(Delegate action) { EventAction = action; Id = TallyEventHandlerCounter.GetEventHandlerId(); }