[This is preliminary documentation and is subject to change.]

A handler that can be attached to the Application.ThreadException event. This handler will submit all unhandled exceptions in the user interface thread to bugcollect.com.

Namespace:  bugcollect
Assembly:  bugcollect (in bugcollect.dll) Version: 1.0.0.0 (1.0)

Syntax

C#
public ThreadExceptionEventHandler ThreadExceptionHandler { get; }
Visual Basic (Declaration)
Public ReadOnly Property ThreadExceptionHandler As ThreadExceptionEventHandler

Remarks

The Application.ThreadException event is not raised by default. To enable this event your application must first call the Application.SetUnhandledExceptionMode method, or overwrite

Examples

CopyC#
static class Program
{
    [STAThread]
    static void Main()
    {
        ReportingManager rm = new ReportingManager(
             Settings.Default.ApplicationName,
             Settings.Default.ApplicationPassword);

        try
        {
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += rm.ThreadExceptionEventHandler;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new ApplicationForm());
        }
        finally
        {
            rm.WaitPendingDone.WaitOne();
        }
    }
}

See Also