C validating canceleventargs
The user must invoke the event differently than other events.
The user should retrieve a collection of the registered event handlers by calling the Get Invocation List method on the Cancel Event Handler.
There is one public method named Launch that raises the Abort Launch event, if not aborted it then ignites the rocket and raises the Launched event.
The following code sample demonstrates how easy it is to create a cancellable event and evaluate the result.
An instance of Cancel Event Args is passed to all the event handlers, which can set Cancel Event Args. The user can add more than one event handler to an event.
It is important to remember an event handler is always a delegate, while a delegate may or may not be an event handler!
The user will notice how this Rocket class raises the Abort Launch event differently in its implementation of the On Abort Launch method.The user should notice how the launch should be aborted in the 2The event passes the same Cancel Event Args instance to all delegates in the invocation list.While this solution works well for events that have only one registered event handler, it creates a problem once the user combines, or chains, multiple event handlers.The internets are full of trivial examples, but I couldn't find a single non-trivial example explaining control validation.Anyway, thanks to Sw Dev Man81 and Hans Passant I am starting from a much better place than yesterday.