|
PortController.NET
ForceBeginInvokeEventFiring Property (Advanced)
Forces the use of EventHandler.BeginInvoke when firing events. This allows the
handling function to examine the sender object to determine which instance of PortController fired an event, but
requires the handling function to use Invoke() when accessing UI properties or methods.
Syntax
[Visual Basic]
object.ForceBeginInvokeEventFiring [ = value ]
[C#]
object.ForceBeginInvokeEventFiring [ = value ]
[C++]
object->ForceBeginInvokeEventFiring [ = value ]
Parameters
object
An object expression that evaluates to a PortController object.
value
A boolean value indicating whether PortController should fire events using EventHandler.BeginInvoke()
Return Value
A boolean value indicating whether PortController should fire events using EventHandler.BeginInvoke().
Default
False
Remarks
ForceBeginInvokeEventFiring is an advanced property that most applications can safely ignore. Normally, PortController
invokes the container form to fire PortController events so that handling functions can access UI properties and methods
without having to call Invoke(). This results in the sender object being the container form instead of a PortController object.
When dealing with multiple instances of PortController, sometimes it is important to be able to determine
the particular PortController instance firing an event. This can be done by setting ForceBeginInvokeEventFiring
to true, but when doing so, be sure that all handler functions access UI components using Invoke().
Errors
None
Example
[Visual Basic]
'Set ForceBeginInvokeEventFiring
myPortController.ForceBeginInvokeEventFiring = True
'Get ForceBeginInvokeEventFiring
Dim forceBeginInvoke As Boolean
forceBeginInvoke = myPortController.ForceBeginInvokeEventFiring
[C#]
// Set ForceBeginInvokeEventFiring
myPortController.ForceBeginInvokeEventFiring = true;
// Get ForceBeginInvokeEventFiring
Boolean forceBeginInvoke = myPortController.ForceBeginInvokeEventFiring;
[C++]
// Set ForceBeginInvokeEventFiring
myPortController->ForceBeginInvokeEventFiring = true;
// Get ForceBeginInvokeEventFiring
Boolean forceBeginInvoke = myPortController->ForceBeginInvokeEventFiring;
|