OpenTok.WinFormsDispatcher

public class WinFormsDispatcher : OpenTok.IDispatcher

Implementation of IDispatcher that uses the Windows Forms Main/UI thread to dispatch events. Available only for Windows Forms applications. Delivery order is guaranteed. All instances of WinFormsDispatcher dispatch events to the Main Application thread, so it doesn't matter whether the same WinFormsDispatcher is always used or a new one is created every time an IDispatcher is required. CPU-intensive or long-running tasks should not be executed in the handlers, as they would block the UI thread and affect performance or responsiveness.

Methods

Name Description
WinFormsDispatcher(mainForm)
DispatchEvent(sender, handler)
DispatchEvent< T >(sender, handler, args)

WinFormsDispatcher(mainForm)

Parameters:
Name Type Description
mainForm Control

DispatchEvent(sender, handler)

Parameters:
Name Type Description
sender object Originator of the event.
handler EventHandler Method to call after scheduling to the new thread.

DispatchEvent< T >(sender, handler, args)

Parameters:
Name Type Description
sender object Originator of the event.
handler EventHandler&lt;T&gt; Method to call after scheduling to the new thread.
args T Parameter to pass to the handler.