File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -185,23 +185,18 @@ Generic `EventArgs` implementation that provides to carry a value.
185
185
186
186
``` c#
187
187
// Specify a named ValueTuple as event argument
188
- event EventHandler < ValueEventArgs < ( bool HasError , string Message ) > > Completed ;
188
+ event EventHandler < ValueEventArgs < int > Completed ;
189
189
190
190
// Publish event
191
- protected virtual void RaiseCompleted (( bool HasError , string Message ) value )
191
+ protected virtual void RaiseCompleted (int value )
192
192
{
193
- this .Completed ? .Invoke (this , new ValueEventArgs <( bool HasError , string Message ) >(value ));
193
+ this .Completed ? .Invoke (this , new ValueEventArgs <int >(value ));
194
194
}
195
195
196
196
// Receive event
197
- private void OnCompleted (object sender , ValueEventArgs < ( bool HasError , string Message ) > e )
197
+ private void OnCompleted (object sender , ValueEventArgs < int > e )
198
198
{
199
- (bool HasError , string Message ) value = e .Value ;
200
- if (newValue .HasError )
201
- {
202
- this .TaskCompletionSource .TrySetException (new InvalidOperationException (value .Message ));
203
- }
204
- this .TaskCompletionSource .TrySetResult (true );
199
+ int value = e .Value ;
205
200
}
206
201
```
207
202
You can’t perform that action at this time.
0 commit comments