-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathIEventHandler.cs
More file actions
88 lines (79 loc) · 3.48 KB
/
IEventHandler.cs
File metadata and controls
88 lines (79 loc) · 3.48 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Copyright © 2017 Dmitry Sikorsky. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace ExtCore.Events;
/// <summary>
/// Describes an event handler that can handle the events broadcasted by the
/// <see cref="Event{TEventHandler}"/> class.
/// </summary>
public interface IEventHandler
{
/// <summary>
/// Priority of the event handler. The event handlers of the same event will be executed in the order
/// specified by the priority.
/// </summary>
int Priority { get; }
/// <summary>
/// Handles the event.
/// </summary>
void HandleEvent();
}
/// <summary>
/// Describes an event handler that can handle the events broadcasted by the
/// <see cref="Event{TEventHandler, TEventArgument}"/> class.
/// </summary>
/// <typeparam name="TEventArgument">Defines the type of the argument that will be passed to the event handler.</typeparam>
public interface IEventHandler<TEventArgument>
{
/// <summary>
/// Priority of the event handler. The event handlers of the same event will be executed in the order
/// specified by the priority.
/// </summary>
int Priority { get; }
/// <summary>
/// Handles the event.
/// </summary>
/// <param name="argument">The event argument.</param>
void HandleEvent(TEventArgument argument);
}
/// <summary>
/// Describes an event handler that can handle the events broadcasted by the
/// <see cref="Event{TEventHandler, TEventArgument1, TEventArgument2}"/> class.
/// </summary>
/// <typeparam name="TEventArgument1">Defines the type of the first argument that will be passed to the event handler.</typeparam>
/// <typeparam name="TEventArgument2">Defines the type of the second argument that will be passed to the event handler.</typeparam>
public interface IEventHandler<TEventArgument1, TEventArgument2>
{
/// <summary>
/// Priority of the event handler. The event handlers of the same event will be executed in the order
/// specified by the priority.
/// </summary>
int Priority { get; }
/// <summary>
/// Handles the event.
/// </summary>
/// <param name="argument1">The first event argument.</param>
/// <param name="argument2">The second event argument.</param>
void HandleEvent(TEventArgument1 argument1, TEventArgument2 argument2);
}
/// <summary>
/// Describes an event handler that can handle the events broadcasted by the
/// <see cref="Event{TEventHandler, TEventArgument1, TEventArgument2, TEventArgument3}"/> class.
/// </summary>
/// <typeparam name="TEventArgument1">Defines the type of the first argument that will be passed to the event handler.</typeparam>
/// <typeparam name="TEventArgument2">Defines the type of the second argument that will be passed to the event handler.</typeparam>
/// <typeparam name="TEventArgument3">Defines the type of the first argument that will be passed to the event handler.</typeparam>
public interface IEventHandler<TEventArgument1, TEventArgument2, TEventArgument3>
{
/// <summary>
/// Priority of the event handler. The event handlers of the same event will be executed in the order
/// specified by the priority.
/// </summary>
int Priority { get; }
/// <summary>
/// Handles the event.
/// </summary>
/// <param name="argument1">The first event argument.</param>
/// <param name="argument2">The second event argument.</param>
/// <param name="argument3">The third event argument.</param>
void HandleEvent(TEventArgument1 argument1, TEventArgument2 argument2, TEventArgument3 argument3);
}