Click or drag to resize
TapiAppLineDeviceState Event
Occurs when the state of a line device has changed.

Namespace: Traysoft.AddTapi
Assembly: Traysoft.AddTapi (in Traysoft.AddTapi.dll) Version: 6.0.0.1110
Syntax
public static event TapiLineDeviceStateEventHandler LineDeviceState

Value

Type: Traysoft.AddTapiTapiLineDeviceStateEventHandler
Remarks

This event is fired when a telephony service provider reports that the state of a line device has changed. Use LineDeviceState property in your event handler to find out which device status item has changed.

Note Note
In Windows Forms and WPF applications AddTapi.NET executes the handler of this event on the main thread of the application (the thread that called Initialize(String)). It is safe to access Windows Forms or WPF controls from the event handler without using Invoke mechanism.
Examples
The following code shows how to handle LineDeviceState event.
TapiApp.Initialize("MyApp");
TapiApp.LineDeviceState += OnLineDeviceState;
...

void OnLineDeviceState(object sender, TapiLineDeviceStateEventArgs args)
{
    // Notify that the line is ringing
    if ((args.LineDeviceState & TapiLineDeviceState.Ringing) != 0)
    {
       Console.WriteLine("Ringing on line {0}", args.Line.Name);
    }
}
See Also