Пример #1
0
 /// <summary>
 /// 显示RPC错误对话框。
 /// </summary>
 /// <param name="owner"></param>
 /// <param name="r">RPC的调用结果。</param>
 public static void ShowResultErrorBox(IWin32Window owner, Rpc.IResult r)
 {
     if (r != null && !r.IsOk)
     {
         var dlg = new ErrorDlg();
         dlg.StartPosition = FormStartPosition.CenterParent;
         dlg.Exception     = r.Exception;
         dlg.ShowDialog(owner);
     }
 }
Пример #2
0
        void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            using (var dlg = new ErrorDlg()) {
                dlg.StartPosition = FormStartPosition.CenterParent;
                dlg.Exception     = e.Exception;
                dlg.ShowDialog(this);
            }

            Close();
        }