示例#1
0
        public static void Show(Exception ex)
        {
            ApplicationException appEx = GetInnerApplicationException(ex);

            if (appEx != null)
            {
                MessageBox.Show(null, appEx.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                using (ErrorBox errorBox = new ErrorBox())
                {
                    errorBox._error         = ex.Message;
                    errorBox._detailedError = ex.ToString();
                    errorBox.Text           = "Error";
                    errorBox.ShowDialog();
                }
            }
        }
示例#2
0
 static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
 {
     ErrorBox.Show(e.Exception);
 }
示例#3
0
		public static void Show( Exception ex )
		{
			ApplicationException appEx = GetInnerApplicationException( ex );
			if( appEx != null )
			{
                MessageBox.Show(null, appEx.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
			}
			else
			{

				using( ErrorBox errorBox = new ErrorBox() )
				{
					errorBox._error = ex.Message;
					errorBox._detailedError = ex.ToString();
					errorBox.Text = "Error";
					errorBox.ShowDialog();
				}
			}
		}
示例#4
0
		public static void Show( string error, string text, string detailedError )
		{
			using( ErrorBox errorBox = new ErrorBox() )
			{
				errorBox._error = error;
				errorBox._detailedError = detailedError;
				errorBox.Text = text;
				errorBox.ShowDialog();
			}
		}