diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index a747ba340..282bb6e43 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -299,81 +299,16 @@ namespace Flow.Launcher.Plugin /// /// Choose the first result after reload if true; keep the last selected result if false. Default is true. public void ReQuery(bool reselect = true); - - /// - /// Displays a message box that has a message and that returns a result. - /// - /// A System.String that specifies the text to display. - /// - /// A System.Windows.MessageBoxResult value that specifies which message box button - /// is clicked by the user. - /// - public MessageBoxResult ShowMsgBox(string messageBoxText); /// - /// Displays a message box that has a message and title bar caption; and that returns - /// a result. + /// Displays a message box like /// - /// A System.String that specifies the text to display. - /// A System.String that specifies the title bar caption to display. - /// - /// A System.Windows.MessageBoxResult value that specifies which message box button - /// is clicked by the user. - /// - public MessageBoxResult ShowMsgBox(string messageBoxText, string caption); - - /// - /// Displays a message box that has a message, title bar caption, and button; and - /// that returns a result. - /// - /// A System.String that specifies the text to display. - /// A System.String that specifies the title bar caption to display. - /// - /// A System.Windows.MessageBoxButton value that specifies which button or buttons - /// to display. - /// - /// - /// A System.Windows.MessageBoxResult value that specifies which message box button - /// is clicked by the user. - /// - public MessageBoxResult ShowMsgBox(string messageBoxText, string caption, MessageBoxButton button); - - /// - /// Displays a message box that has a message, title bar caption, button, and icon; - /// and that returns a result. - /// - /// A System.String that specifies the text to display. - /// A System.String that specifies the title bar caption to display. - /// - /// A System.Windows.MessageBoxButton value that specifies which button or buttons - /// to display. - /// - /// A System.Windows.MessageBoxImage value that specifies the icon to display. - /// - /// A System.Windows.MessageBoxResult value that specifies which message box button - /// is clicked by the user. - /// - public MessageBoxResult ShowMsgBox(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon); - - /// - /// Displays a message box that has a message, title bar caption, button, and icon; - /// and that accepts a default message box result and returns a result. - /// - /// A System.String that specifies the text to display. - /// A System.String that specifies the title bar caption to display. - /// - /// A System.Windows.MessageBoxButton value that specifies which button or buttons - /// to display. - /// - /// A System.Windows.MessageBoxImage value that specifies the icon to display. - /// - /// A System.Windows.MessageBoxResult value that specifies the default result of - /// the message box. - /// - /// - /// A System.Windows.MessageBoxResult value that specifies which message box button - /// is clicked by the user. - /// - public MessageBoxResult ShowMsgBox(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult); + /// The message of the message box. + /// The caption of the message box. + /// Specifies which button or buttons to display. + /// Specifies the icon to display. + /// Specifies the default result of the message box. + /// Specifies which message box button is clicked by the user. + public MessageBoxResult ShowMsgBox(string messageBoxText, string caption = "", MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.OK); } } diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 33739bda2..0e567cdd4 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -319,17 +319,7 @@ namespace Flow.Launcher public void ReQuery(bool reselect = true) => _mainVM.ReQuery(reselect); - public MessageBoxResult ShowMsgBox(string messageBoxText) => MessageBoxEx.Show(messageBoxText); - - public MessageBoxResult ShowMsgBox(string messageBoxText, string caption) => MessageBoxEx.Show(messageBoxText, caption); - - public MessageBoxResult ShowMsgBox(string messageBoxText, string caption, MessageBoxButton button) => - MessageBoxEx.Show(messageBoxText, caption, button); - - public MessageBoxResult ShowMsgBox(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon) => - MessageBoxEx.Show(messageBoxText, caption, button, icon); - - public MessageBoxResult ShowMsgBox(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult) => + public MessageBoxResult ShowMsgBox(string messageBoxText, string caption = "", MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.OK) => MessageBoxEx.Show(messageBoxText, caption, button, icon, defaultResult); #endregion