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); } }
protected abstract Task OnFileRecievingPrepared(FileRecievingPreparedEventArgs args);