Пример #1
0
        public static void ShowError(string friendMessage, Exception ex)
        {
            if (ex == null)
            {
                return;
            }
            frmErrorBox f      = new frmErrorBox();
            Exception   realex = getrealexp(ex);

            try
            {
                string message = string.Empty;
                if (realex is MessageSecurityException)
                {
                    FaultException exception = realex.InnerException as FaultException;
                    if (exception != null)
                    {
                        message = exception.Message;
                    }
                }

                f.SetException(realex);
                f.txtError.Text = friendMessage + message;
                f.ShowDialog();
            }
            finally
            {
                f.Dispose();
            }
        }
Пример #2
0
        public static void ShowError(Exception ex)
        {
            frmErrorBox f = new frmErrorBox();

            try
            {
                f.SetException(ex);
                f.ShowDialog();
            }
            finally
            {
                f.Dispose();
            }
        }