using System.Windows.Forms;
using Elfisa.UI.Dialogs;

namespace Электронная_Фармация.Classes
{
    public static class UiDialogs
    {
        public static void ShowError(string message, string title = "Ошибка", IWin32Window owner = null)
        {
            ModernMessageBox.Show(owner ?? GetOwner(), title, message);
        }

        public static void ShowInfo(string message, string title = "Сообщение", IWin32Window owner = null)
        {
            ModernMessageBox.Show(owner ?? GetOwner(), title, message);
        }

        public static DialogResult ConfirmYesNo(string message, string title, IWin32Window owner = null)
        {
            return ModernMessageBox.Show(owner ?? GetOwner(), title, message, ModernMessageButtons.YesNo);
        }

        public static DialogResult ConfirmYesNoCancel(string message, string title, IWin32Window owner = null)
        {
            return ModernMessageBox.Show(owner ?? GetOwner(), title, message, ModernMessageButtons.YesNoCancel);
        }

        private static IWin32Window GetOwner()
        {
            return Form.ActiveForm;
        }
    }
}
