TapiAppUseSynchronizationContext Property |
Namespace: Traysoft.AddTapi
When the application initializes AddTapi.NET, AddTapi.NET acquires SynchronizationContext of the thread that called Initialize(String) method. If UseSynchronizationContext property is true, AddTapi.NET uses acquired synchronization context to send events to the application. This mechanism ensures that events arrive to the UI thread of the application and the application can access UI controls from the event handlers.
Set UseSynchronizationContext to false if you want AddTapi.NET to call event handlers on a separate thread. In this case the application will need to use its own synchronization mechanism to access UI controls from the event handlers.
This property has no effect for service applications. Applications that run as Windows service do not have synchronization context by default. All event handlers are called on a separate thread in service applications.
UseSynchronizationContext must be set to false for ASP.NET applications. If UseSynchronizationContext is not set to false, AddTapi.NET might try to invoke callback on a disposed thread causing exception or crash.