AddTapi.NET Developer's Manual
LineClosed Event
NamespacesTraysoft.AddTapiTapiAppLineClosed
Occurs when a line is forcibly closed by Windows because of hardware error or configuration changes.
Declaration Syntax
C#Visual BasicVisual C++
public static event TapiEventHandler LineClosed
Public Shared Event LineClosed As TapiEventHandler
public:
static  event TapiEventHandler^ LineClosed {
	void add (TapiEventHandler^ value);
	void remove (TapiEventHandler^ value);
}
Remarks
This event occurs when a telephony line that the application opened by calling Open(Boolean, TapiCallHandler) has been forcibly closed by Windows. The common cause is a hardware error or incorrect device driver. The application should report this error to the user and try to open the line again at later time.
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 LineClosed event.

C#

            TapiApp.Initialize("MyApp");
            TapiApp.LineClosed += OnLineClosed;
            ...
            
            void OnLineClosed(object sender, TapiEventArgs args)
            {
                // Display a message to the user
                Console.WriteLine("{0} has been forcibly closed", args.Line.Name);
            }
            

VB.NET

            TapiApp.Initialize("MyApp")
            AddHandler TapiApp.LineClosed, AddressOf OnLineClosed
            ...
            
            Private Sub OnLineClosed(ByVal sender As Object, ByVal args As TapiEventArgs)
                ' Display a message to the user
                Console.WriteLine("{0} has been forcibly closed", args.Line.Name)
            End Sub
            

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