You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.0 KiB

1 year ago
using System;
using System.Windows.Forms;
namespace CK.SCP.Utils
{
public static class MessageHelper
{
public static void ShowError(Exception ex)
{
MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogHelper.Write(ex.ToString());
}
public static void ShowError(string msg)
{
MessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogHelper.Write(msg);
}
public static DialogResult ShowWarning(string msg)
{
return MessageBox.Show(msg, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
public static DialogResult ShowQuestion(string msg)
{
return MessageBox.Show(msg, "问题", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
}
public static void ShowInfo(string msg)
{
MessageBox.Show(msg, "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}