예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        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);
                }
            }
        }
예제 #3
0
파일: Logger.cs 프로젝트: Azyyyyyy/HATE
 public static void Log(MessageType messageType, string message, bool wait = false)
 {
     MessageHandle?.Invoke(new MessageEventArgs(messageType, message, wait));
 }