Revisão | c5d296b98dfe25925103717a32b4796a6b66924b (tree) |
---|---|
Hora | 2022-05-31 13:26:18 |
Autor | yoshy <yoshy.org.bitbucket@gz.j...> |
Commiter | yoshy |
[MOD] EventWrapper.Subscribe をメソッドチェーン化
@@ -11,10 +11,12 @@ namespace CleanAuLait48.Core.Event | ||
11 | 11 | |
12 | 12 | private bool disposedValue; |
13 | 13 | |
14 | - public void Subscribe(Action handler) | |
14 | + public EventWrapper Subscribe(Action handler) | |
15 | 15 | { |
16 | 16 | Events += handler; |
17 | 17 | handlers.Add(handler); |
18 | + | |
19 | + return this; | |
18 | 20 | } |
19 | 21 | |
20 | 22 | public void Unsubscribe(Action handler) |
@@ -69,10 +71,12 @@ namespace CleanAuLait48.Core.Event | ||
69 | 71 | this.sender = sender; |
70 | 72 | } |
71 | 73 | |
72 | - public void Subscribe(EventHandler<T> handler) | |
74 | + public EventWrapper<T> Subscribe(EventHandler<T> handler) | |
73 | 75 | { |
74 | 76 | Events += handler; |
75 | 77 | handlers.Add(handler); |
78 | + | |
79 | + return this; | |
76 | 80 | } |
77 | 81 | |
78 | 82 | public void Unsubscribe(EventHandler<T> handler) |