E
Edward Diener
I am gathering from the documentation that return values from __events are
not illegal but are frowned upon in .NET. If this is the case, does one pass
back values from an event handler via "in/out" or "out" parameters ? Or is
it simply that events are just notifications and are not interested in any
values which event handlers might be able to return ?
If the latter is the case, the event model in .NET appears to have a great
shortcoming. Let's say I have an event in a component which will normally be
occurring but which can be cancelled by a possible event handler before the
event occurs. This appears to me to be a common design idiom, which I have
used in my own non-.NET code. How does one handle this situation using
events in .NET ? I would much prefer my component's event notification to
possibly pick up this fact from some event handler and react accordingly,
but if events aren't supposed to pass back values, either via return values
or "in/out" | "out' values this idiom does not work.
not illegal but are frowned upon in .NET. If this is the case, does one pass
back values from an event handler via "in/out" or "out" parameters ? Or is
it simply that events are just notifications and are not interested in any
values which event handlers might be able to return ?
If the latter is the case, the event model in .NET appears to have a great
shortcoming. Let's say I have an event in a component which will normally be
occurring but which can be cancelled by a possible event handler before the
event occurs. This appears to me to be a common design idiom, which I have
used in my own non-.NET code. How does one handle this situation using
events in .NET ? I would much prefer my component's event notification to
possibly pick up this fact from some event handler and react accordingly,
but if events aren't supposed to pass back values, either via return values
or "in/out" | "out' values this idiom does not work.