mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve MessageBoxEx paramters as System.Windows.MessageBox for readability
This commit is contained in:
parent
3ae960d275
commit
6feca10bdb
1 changed files with 15 additions and 15 deletions
|
|
@ -37,39 +37,39 @@ namespace Flow.Launcher.Core
|
||||||
|
|
||||||
|
|
||||||
/// 1 parameter
|
/// 1 parameter
|
||||||
public static MessageBoxResult Show(string msg)
|
public static MessageBoxResult Show(string messageBoxText)
|
||||||
{
|
{
|
||||||
return Show(string.Empty, msg, MessageBoxButton.OK, MessageBoxImage.None);
|
return Show(string.Empty, messageBoxText, MessageBoxButton.OK, MessageBoxImage.None);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2 parameter
|
// 2 parameter
|
||||||
public static MessageBoxResult Show(string caption, string text)
|
public static MessageBoxResult Show(string messageBoxText, string title)
|
||||||
{
|
{
|
||||||
return Show(caption, text, MessageBoxButton.OK, MessageBoxImage.None);
|
return Show(messageBoxText, title, MessageBoxButton.OK, MessageBoxImage.None);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 3 parameter
|
/// 3 parameter
|
||||||
public static MessageBoxResult Show(string caption, string msg, MessageBoxType type)
|
public static MessageBoxResult Show(string messageBoxText, string title, MessageBoxType type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case MessageBoxType.ConfirmationWithYesNo:
|
case MessageBoxType.ConfirmationWithYesNo:
|
||||||
return Show(caption, msg, MessageBoxButton.YesNo,
|
return Show(messageBoxText, title, MessageBoxButton.YesNo,
|
||||||
MessageBoxImage.Question);
|
MessageBoxImage.Question);
|
||||||
case MessageBoxType.YesNo:
|
case MessageBoxType.YesNo:
|
||||||
return Show(caption, msg, MessageBoxButton.YesNo,
|
return Show(messageBoxText, title, MessageBoxButton.YesNo,
|
||||||
MessageBoxImage.Question);
|
MessageBoxImage.Question);
|
||||||
case MessageBoxType.ConfirmationWithYesNoCancel:
|
case MessageBoxType.ConfirmationWithYesNoCancel:
|
||||||
return Show(caption, msg, MessageBoxButton.YesNoCancel,
|
return Show(messageBoxText, title, MessageBoxButton.YesNoCancel,
|
||||||
MessageBoxImage.Question);
|
MessageBoxImage.Question);
|
||||||
case MessageBoxType.Information:
|
case MessageBoxType.Information:
|
||||||
return Show(caption, msg, MessageBoxButton.OK,
|
return Show(messageBoxText, title, MessageBoxButton.OK,
|
||||||
MessageBoxImage.Information);
|
MessageBoxImage.Information);
|
||||||
case MessageBoxType.Error:
|
case MessageBoxType.Error:
|
||||||
return Show(caption, msg, MessageBoxButton.OK,
|
return Show(messageBoxText, title, MessageBoxButton.OK,
|
||||||
MessageBoxImage.Error);
|
MessageBoxImage.Error);
|
||||||
case MessageBoxType.Warning:
|
case MessageBoxType.Warning:
|
||||||
return Show(caption, msg, MessageBoxButton.OK,
|
return Show(messageBoxText, title, MessageBoxButton.OK,
|
||||||
MessageBoxImage.Warning);
|
MessageBoxImage.Warning);
|
||||||
default:
|
default:
|
||||||
return MessageBoxResult.No;
|
return MessageBoxResult.No;
|
||||||
|
|
@ -77,12 +77,12 @@ namespace Flow.Launcher.Core
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4 parameter, Final Display Message.
|
// 4 parameter, Final Display Message.
|
||||||
public static MessageBoxResult Show(string caption, string text, MessageBoxButton button, MessageBoxImage image)
|
public static MessageBoxResult Show(string messageBoxText, string title, MessageBoxButton button, MessageBoxImage image)
|
||||||
{
|
{
|
||||||
msgBox = new MessageBoxEx();
|
msgBox = new MessageBoxEx();
|
||||||
msgBox.TitleTextBlock.Text = text;
|
msgBox.TitleTextBlock.Text = title;
|
||||||
msgBox.DescTextBlock.Text = caption;
|
msgBox.DescTextBlock.Text = messageBoxText;
|
||||||
msgBox.Title = text;
|
msgBox.Title = title;
|
||||||
SetVisibilityOfButtons(button);
|
SetVisibilityOfButtons(button);
|
||||||
SetImageOfMessageBox(image);
|
SetImageOfMessageBox(image);
|
||||||
msgBox.ShowDialog();
|
msgBox.ShowDialog();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue