|
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace SIP_Proxy_demo
{
/// <summary>
/// Application main class.
/// </summary>
public static class Program
{
#region static method Main
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
public static void Main()
{
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new wfrm_Main());
}
#endregion
#region method CurrentDomain_UnhandledException
/// <summary>
/// This method is called when unhandled exception happens.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private static void CurrentDomain_UnhandledException(object sender,UnhandledExceptionEventArgs e)
{
MessageBox.Show(null,"Error:\r\n" + ((Exception)e.ExceptionObject).ToString(),"Unhandled Error:",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
#endregion
#region method Application_ThreadException
/// <summary>
/// This method is called when unhandled exception happens.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private static void Application_ThreadException(object sender,System.Threading.ThreadExceptionEventArgs e)
{
MessageBox.Show(null,"Error:\r\n" + e.Exception.ToString(),"Unhandled Error:",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.