TapiAppLineDeviceState Event |
Occurs when the state of a line device has changed.
Namespace: Traysoft.AddTapiAssembly: Traysoft.AddTapi (in Traysoft.AddTapi.dll) Version: 6.0.0.1110
Syntax public static event TapiLineDeviceStateEventHandler LineDeviceState
Public Shared Event LineDeviceState As TapiLineDeviceStateEventHandler
public:
static event TapiLineDeviceStateEventHandler^ LineDeviceState {
void add (TapiLineDeviceStateEventHandler^ value);
void remove (TapiLineDeviceStateEventHandler^ value);
}
Value
Type:
Traysoft.AddTapiTapiLineDeviceStateEventHandlerRemarks
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 |
---|
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)
{
if ((args.LineDeviceState & TapiLineDeviceState.Ringing) != 0)
{
Console.WriteLine("Ringing on line {0}", args.Line.Name);
}
}
TapiApp.Initialize("MyApp")
AddHandler TapiApp.LineDeviceState, AddressOf OnLineDeviceState
...
Private Sub OnLineDeviceState(ByVal sender As Object, ByVal args As TapiLineDeviceStateEventArgs)
If args.LineDeviceState And TapiLineDeviceState.Ringing Then
Console.WriteLine("Ringing on line {0}", args.Line.Name)
End If
End Sub
No code example is currently available or this language may not be supported.
See Also