public bool HandleEvents { get; set; }
Public Property HandleEvents As Boolean
Get
Set
public:
property bool HandleEvents {
bool get ();
void set (bool value);
}
member HandleEvents : bool with get, set
When HandleEvents is set to true, you must prevent users from triggering a call to Compute while another such call is currently in progress. One way to do this is to disable any means of triggering computations as soon as one is started, such as by disabling a "Compute" button once it has been clicked. Another possibility is to have your event handler methods check the IsComputing property and not call Compute if that property gives true.
If you go ahead and try to make a reentrant call to Compute, an InvalidOperationException will be thrown by the reentrant call to Compute.The event handling is implemented via a Yield event handler that calls the .NET Framework method Application.DoEvents.