public static void Broadcast <T>(this IMessageDispatcher dispatcher, int messageId, T arg) { Type containterType = dispatcher.GetContainerType(); var method = GetMethod(containterType, messageId); if (method != null) { MessageHandle <T> handle = (MessageHandle <T>)method; if (handle != null) { handle.Invoke(arg); } } }
public static void Broadcast <T0, T1, T2, T3>(this IMessageDispatcher dispatcher, int messageId, T0 arg0, T1 arg1, T2 arg2, T3 arg3) { Type containterType = dispatcher.GetContainerType(); var method = GetMethod(containterType, messageId); if (method != null) { MessageHandle <T0, T1, T2, T3> handle = (MessageHandle <T0, T1, T2, T3>)method; if (handle != null) { handle.Invoke(arg0, arg1, arg2, arg3); } } }
public static void Log(MessageType messageType, string message, bool wait = false) { MessageHandle?.Invoke(new MessageEventArgs(messageType, message, wait)); }