示例#1
0
        public static async Task InvokeAsync <T1, T2, T3, T4, T5>(this AsyncEvent <Func <T1, T2, T3, T4, T5, Task> > eventHandler, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
        {
            var subscribers = eventHandler.Subscriptions;

            for (int i = 0; i < subscribers.Count; i++)
            {
                await subscribers[i].Invoke(arg1, arg2, arg3, arg4, arg5).ConfigureAwait(false);
            }
        }
示例#2
0
        public static async Task InvokeAsync <T>(this AsyncEvent <Func <T, Task> > eventHandler, T arg)
        {
            var subscribers = eventHandler.Subscriptions;

            for (int i = 0; i < subscribers.Count; i++)
            {
                await subscribers[i].Invoke(arg).ConfigureAwait(false);
            }
        }