AddTapi.NET Developer's Manual
LineAdded Event
NamespacesTraysoft.AddTapiTapiAppLineAdded
Occurs when a new line device is added to the system.
Declaration Syntax
C#Visual BasicVisual C++
public static event TapiEventHandler LineAdded
Public Shared Event LineAdded As TapiEventHandler
public:
static  event TapiEventHandler^ LineAdded {
	void add (TapiEventHandler^ value);
	void remove (TapiEventHandler^ value);
}
Remarks
This event occurs when a new telephony line device is detected while the application is running, for example, when a USB modem is connected to the system. New TapiLine object is added to 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 LineAdded event.

C#

            TapiApp.Initialize("MyApp");
            TapiApp.LineAdded += OnLineAdded;
            ...
            
            void OnLineAdded(object sender, TapiEventArgs args)
            {
                // Display the name of newly added line
                Console.WriteLine("{0} added", args.Line.Name);
            }
            

VB.NET

            TapiApp.Initialize("MyApp")
            AddHandler TapiApp.LineAdded, AddressOf OnLineAdded
            ...
            
            Private Sub OnLineAdded(ByVal sender As Object, ByVal args As TapiEventArgs)
                ' Display the name of newly added line
                Console.WriteLine("{0} added", args.Line.Name)
            End Sub
            

Assembly: Traysoft.AddTapi (Module: Traysoft.AddTapi)