public static DXMessageBox Show(string message, string caption, DialogAction action = DialogAction.None) { DXMessageBox box = new DXMessageBox(message, caption); switch (action) { case DialogAction.None: break; case DialogAction.Close: box.OKButton.MouseClick += (o, e) => CEnvir.Target.Close(); box.CloseButton.MouseClick += (o, e) => CEnvir.Target.Close(); break; case DialogAction.ReturnToLogin: box.OKButton.MouseClick += (o, e) => CEnvir.ReturnToLogin(); box.CloseButton.MouseClick += (o, e) => CEnvir.ReturnToLogin(); break; } return(box); }