ScriptingOnEvent Method (ScriptingEventsList, CancellationToken) |
Creates an adhoc event binding to act on.
Namespace:
RRAutoLib.Scripting
Assembly:
RRAutoLib (in RRAutoLib.dll) Version: 4.0.8678.28884
Syntax
RemarksThis method was designed specifically for use within the scripting context and is only safe to be called on the CTC thread.
Examples
In the following example, execution will halt until either of the two bound buttons are activated (pressed).
Optionally the
e.CancelToken passed from the hosting script object, can be handed down to this method so it can participate
in a cancellation order received from the parent script.
Await OnEvent(New EventsList() From {
{CtcButton("Button1"), "Activated"},
{CtcButton("Button2"), "Activated"}},
e.CancelToken)
See other overload, for a version of this method, that can additionally execute some script, when the events are raised.
See Also