예제 #1
0
        protected override Task OnFileRecievingPrepared(FileRecievingPreparedEventArgs args)
        {
            Func <object, FileRecievingPreparedEventArgs, Task> handlerEvent = FileRecievingPreparedEvent;

            if (handlerEvent == null)
            {
                return(Task.FromResult(false));
            }

            try
            {
                Delegate[] invocationList = handlerEvent.GetInvocationList();
                var        handlerTasks   =
                    invocationList.Select(
                        delegatee => ((Func <object, FileRecievingPreparedEventArgs, Task>)delegatee)(this, args));
                return(Task.WhenAll(handlerTasks));
            }
            catch (Exception ex)
            {
                return(Task.CompletedTask);
            }
        }
예제 #2
0
 protected abstract Task OnFileRecievingPrepared(FileRecievingPreparedEventArgs args);