In consideration of the brief sample code at the following link...
http://msdn2.microsoft.com/en-us/lib...gs.cancel.aspx
.... when we set e.Cancel = true, How does the form subsequently know to NOT
close the form? More generally, after an event is raised, does the event
raising class somehow retain a reference to the CancelEventArgs instance,
and then check the value of the .Cancel property to subsequently know if
further processing (e.g., actually close the form) is to be aborted? Is it
that simple?
The upshot here is that I'm looking into providing a cancellable events -
and I was wondering how I might make use of CancelEventArgs.Cancel. My plan
is to derive a new "event args" class from CancelEventArgs, and let the
client set the .Cancel property - just like we can set that property for the
FormClosing event.
Thanks!