コード例 #1
0
        static public void Broadcast <TReturn>(string eventType, Action <TReturn> returnCall, MessengerMode mode)
        {
            MessengerInternal.OnBroadcasting(eventType, mode);
            var invocationList = MessengerInternal.GetInvocationList <Func <TReturn> >(eventType);

            foreach (var result in invocationList.Select(del => del.Invoke()).Cast <TReturn>())
            {
                returnCall.Invoke(result);
            }
        }
コード例 #2
0
        static public void Broadcast(string eventType, MessengerMode mode)
        {
            MessengerInternal.OnBroadcasting(eventType, mode);
            var invocationList = MessengerInternal.GetInvocationList <Action>(eventType);

            foreach (var callback in invocationList)
            {
                callback.Invoke();
            }
        }
コード例 #3
0
        public void Broadcast <TReturn>(string eventType, Action <TReturn> returnCall, MessengerMode mode)
        {
            MessengerInternal.OnBroadcasting(eventType, mode);
            var invocationList = MessengerInternal.GetInvocationList <Func <TReturn> >(eventType);

            if (invocationList == null && mode == MessengerMode.DONT_REQUIRE_LISTENER)
            {
                return;
            }
            foreach (var result in invocationList.Select(del => del.Invoke()).Cast <TReturn>())
            {
                returnCall.Invoke(result);
            }
        }
コード例 #4
0
        public void Broadcast(string eventType, MessengerMode mode)
        {
            MessengerInternal.OnBroadcasting(eventType, mode);
            var invocationList = MessengerInternal.GetInvocationList <Action>(eventType);

            if (invocationList == null && mode == MessengerMode.DONT_REQUIRE_LISTENER)
            {
                return;
            }
            foreach (var callback in invocationList)
            {
                callback.Invoke();
            }
        }