removal of TaskDialog usage...

This commit is contained in:
Frank Skare
2021-05-23 19:30:21 +02:00
parent 0b28770d1a
commit eaa8a3ca6c
59 changed files with 1035 additions and 7065 deletions

39
src/Misc/Msg.cs Normal file
View File

@@ -0,0 +1,39 @@

using System;
using System.Windows.Forms;
public class Msg
{
public static void ShowInfo(object title, object content = null)
{
Show(title, content, MessageBoxIcon.Information);
}
public static void ShowError(object title, object content = null)
{
Show(title, content, MessageBoxIcon.Error);
}
public static void ShowWarning(object title, object content = null)
{
Show(title, content, MessageBoxIcon.Warning);
}
public static DialogResult ShowQuestion(object title, object content = null,
MessageBoxButtons buttons = MessageBoxButtons.OKCancel)
{
return Show(title, content, MessageBoxIcon.Question, buttons);
}
public static void ShowException(Exception exception)
{
Show(exception, null, MessageBoxIcon.Error);
}
public static DialogResult Show(object title, object content, MessageBoxIcon icon,
MessageBoxButtons buttons = MessageBoxButtons.OK)
{
string msg = (title?.ToString().TrimEx() + "\n\n" + content?.ToString().TrimEx()).Trim();
return MessageBox.Show(msg, Application.ProductName, buttons, icon);
}
}