/// <summary> /// void DisplayMessage(string msg) /// Display a dialog message /// </summary> /// <param name="msg"></param> public static bool DisplayMessage(string msg) { string _msg = msg; DialogResult result3 = new DialogResult(); bool _status = true; try { frmMessageBox _msgBox = new frmMessageBox(_msg); _msgBox.ShowDialog(); _status = _msgBox.Status; _msgBox.Close(); } catch (Exception ex) { CommonRoutines.Log("$E:" + moduleName + ".DisplayMessage > " + ex.Message); } return _status; }
/// <summary> /// void DisplayErrorMessage(string msg) /// Display a dialog message /// </summary> /// <param name="msg"></param> public static void DisplayErrorMessage(string msg) { string _msg = msg; DialogResult result3 = new DialogResult(); try { frmMessageBox _msgBox = new frmMessageBox(_msg); _msgBox.ShowDialog(); // set the global error message CommonRoutines.Log(msg); } catch (Exception ex) { CommonRoutines.Log("$E:" + moduleName + ".DisplayErrorMessage > trying to display message " + msg); int _userHandles = GetHandleCount(); CommonRoutines.Log("$E:" + moduleName + ".DisplayErrorMessage (Handles) > " + _userHandles.ToString()); CommonRoutines.Log("$E:" + moduleName + ".DisplayErrorMessage > " + ex.Message); CommonRoutines.Log("$E:" + moduleName + ".DisplayErrorMessage (Exception) > " + ex.ToString()); var _stackTrace = new System.Diagnostics.StackTrace(true); CommonRoutines.Log("$E:" + moduleName + ".DisplayErrorMessage (Stack) > " + _stackTrace.ToString()); } return; }