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. More...

Inherits OpenTok.IDispatcher.

Public Member Functions
WinFormsDispatcher (Control mainForm)
void DispatchEvent (object sender, EventHandler handler)
Schedules a parameterless event. More...
void DispatchEvent< T > (object sender, EventHandler< T > handler, T args)
Schedules a typed parameter event. More...
void DispatchEvent (object sender, EventHandler handler)
Schedules a parameterless event. More...
void DispatchEvent< T > (object sender, EventHandler< T > handler, T args)
Schedules a typed parameter event. More...

Detailed Description

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.

Member Function Documentation

DispatchEvent()

void OpenTok.WinFormsDispatcher.DispatchEvent ( object sender,
EventHandler handler
)

Schedules a parameterless event.

Parameters : | | | | --- | --- | | sender | Originator of the event. | | handler | Method to call after scheduling to the new thread. |

Implements OpenTok.IDispatcher.

DispatchEvent< T >()

void OpenTok.WinFormsDispatcher.DispatchEvent< T > ( object sender,
EventHandler< T > handler,
T args
)

Schedules a typed parameter event.

Template Parameters : | | | | --- | --- | | T | The type of the parameter |

Parameters : | | | | --- | --- | | sender | Originator of the event. | | handler | Method to call after scheduling to the new thread. | | args | Parameter to pass to the handler. |

Implements OpenTok.IDispatcher.

Type Constraints : | | | | | | --- | --- | --- | --- | | T | : | EventArgs | |