public static void SendEvent(string eventName, TypeOfMessage messageType) { BroadcasterInner.OnBroadcastMessage(eventName, messageType); Delegate type; if (tableName.TryGetValue(eventName, out type)) { Call c = type as Call; if (c != null) { c(); } else { throw BroadcasterInner.GenerateMessageException(eventName); } } }
public static void DisableListener(string eventName, Call handlingMethod) { BroadcasterInner.OnListenerDisable(eventName, handlingMethod); tableName[eventName] = (Call)tableName[eventName] - handlingMethod; BroadcasterInner.OnListenerDisabled(eventName); }
public static void EnableListener(string eventName, Call handlingMethod) { BroadcasterInner.OnListenerEnable(eventName, handlingMethod); tableName[eventName] = (Call)tableName[eventName] + handlingMethod; }