Occurs when existing line device is removed.
| C# | Visual Basic | Visual C++ |
public static event TapiEventHandler LineRemoved
Public Shared Event LineRemoved As TapiEventHandler
public: static event TapiEventHandler^ LineRemoved { void add (TapiEventHandler^ value); void remove (TapiEventHandler^ value); }
This event occurs when a telephony line device is removed while the application is running, for example, when a USB modem is disconnected.
TapiLine object representing the removed device is removed from the Lines collection before this event is fired.
| In Windows Forms application 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 controls from the event handler without using Invoke mechanism. |
The following code shows how to process LineRemoved event.
C#
TapiApp.Initialize("MyApp");
TapiApp.LineRemoved += OnLineRemoved;
...
void OnLineRemoved(object sender, TapiEventArgs args)
{
// Display the name of the removed line
Console.WriteLine("{0} has been removed", args.Line.Name);
}
VB.NET
TapiApp.Initialize("MyApp")
AddHandler TapiApp.LineRemoved, AddressOf OnLineRemoved
...
Private Sub OnLineRemoved(ByVal sender As Object, ByVal args As TapiEventArgs)
' Display the name of the removed line
Console.WriteLine("{0} has been removed", args.Line.Name)
End Sub
Assembly: Traysoft.AddTapi (Module: Traysoft.AddTapi)