AddTapi.NET Developer's Manual
LineRemoved Event
NamespacesTraysoft.AddTapiTapiAppLineRemoved
Occurs when existing line device is removed.
Declaration Syntax
C#Visual BasicVisual 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);
}
Remarks
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.
Note:
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.
Examples
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)