-
-
Notifications
You must be signed in to change notification settings - Fork 319
Expand file tree
/
Copy pathAsyncEventHandler.cs
More file actions
39 lines (36 loc) · 1.57 KB
/
Copy pathAsyncEventHandler.cs
File metadata and controls
39 lines (36 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Threading.Tasks;
namespace DSharpPlus.AsyncEvents;
/// <summary>
/// Provides a registration surface for asynchronous events using C# language event syntax.
/// </summary>
/// <typeparam name="TSender">The type of the event dispatcher.</typeparam>
/// <typeparam name="TArgs">The type of the argument object for this event.</typeparam>
/// <param name="sender">The instance that dispatched this event.</param>
/// <param name="args">The arguments passed to this event.</param>
public delegate Task AsyncEventHandler<in TSender, in TArgs>
(
TSender sender,
TArgs args
)
where TArgs : AsyncEventArgs;
/// <summary>
/// Provides a registration surface for a handler for exceptions raised by an async event or its registered
/// event handlers.
/// </summary>
/// <typeparam name="TSender">The type of the event dispatcher.</typeparam>
/// <typeparam name="TArgs">The type of the argument object for this event.</typeparam>
/// <param name="event">The async event that threw this exception.</param>
/// <param name="exception">The thrown exception.</param>
/// <param name="handler">The async event handler that threw this exception.</param>
/// <param name="sender">The instance that dispatched this event.</param>
/// <param name="args">The arguments passed to this event.</param>
public delegate void AsyncEventExceptionHandler<TSender, TArgs>
(
AsyncEvent<TSender, TArgs> @event,
Exception exception,
AsyncEventHandler<TSender, TArgs> handler,
TSender sender,
TArgs args
)
where TArgs : AsyncEventArgs;