Exemplo n.º 1
0
        public void ShowMessage(string message, string title, Moai.Platform.UI.MessageBoxButtons buttons, Moai.Platform.UI.MessageBoxIcon icon)
        {
            System.Windows.Forms.MessageBoxButtons nativeButtons;
            System.Windows.Forms.MessageBoxIcon    nativeIcon;
            switch (buttons)
            {
            case Moai.Platform.UI.MessageBoxButtons.OK:
                nativeButtons = System.Windows.Forms.MessageBoxButtons.OK;
                break;

            case Moai.Platform.UI.MessageBoxButtons.OKCancel:
                nativeButtons = System.Windows.Forms.MessageBoxButtons.OKCancel;
                break;

            case Moai.Platform.UI.MessageBoxButtons.YesNo:
                nativeButtons = System.Windows.Forms.MessageBoxButtons.YesNo;
                break;

            default:
                throw new NotSupportedException();
            }
            switch (icon)
            {
            case Moai.Platform.UI.MessageBoxIcon.None:
                nativeIcon = System.Windows.Forms.MessageBoxIcon.None;
                break;

            case Moai.Platform.UI.MessageBoxIcon.Information:
                nativeIcon = System.Windows.Forms.MessageBoxIcon.Information;
                break;

            case Moai.Platform.UI.MessageBoxIcon.Warning:
                nativeIcon = System.Windows.Forms.MessageBoxIcon.Warning;
                break;

            case Moai.Platform.UI.MessageBoxIcon.Error:
                nativeIcon = System.Windows.Forms.MessageBoxIcon.Error;
                break;

            default:
                throw new NotSupportedException();
            }

            MessageBox.Show(message, title, nativeButtons, nativeIcon);
        }
Exemplo n.º 2
0
 public void ShowMessage(string message, string title, Moai.Platform.UI.MessageBoxButtons buttons)
 {
     this.ShowMessage(message, title, buttons, Moai.Platform.UI.MessageBoxIcon.None);
 }