AppVeyor.UI.Common.VsShellHelper.ShowMessageBox C# (CSharp) Method

ShowMessageBox() public static method

Shows a message box.
public static ShowMessageBox ( string text, string helpKeyword, MessageBoxButtons buttons, MessageBoxIcon icon, string title = "AppVeyor" ) : DialogResult
text string The text.
helpKeyword string The help keyword.
buttons MessageBoxButtons The buttons.
icon MessageBoxIcon The icon.
title string The title.
return DialogResult
        public static DialogResult ShowMessageBox(string text, string helpKeyword, MessageBoxButtons buttons, MessageBoxIcon icon, string title = "AppVeyor")
        {
            IVsUIShell uiShellService = Package.GetGlobalService(typeof(SVsUIShell)) as IVsUIShell;

            int pnResult = 1;

            if (uiShellService != null)
            {
                Guid empty = Guid.Empty;
                OLEMSGBUTTON msgbtn = (OLEMSGBUTTON)buttons;
                OLEMSGICON msgicon = OLEMSGICON.OLEMSGICON_INFO;

                switch (icon)
                {
                    case MessageBoxIcon.Question:
                        msgicon = OLEMSGICON.OLEMSGICON_QUERY;
                        break;

                    case MessageBoxIcon.Exclamation:
                        msgicon = OLEMSGICON.OLEMSGICON_WARNING;
                        break;

                    case MessageBoxIcon.Asterisk:
                        msgicon = OLEMSGICON.OLEMSGICON_INFO;
                        break;

                    case MessageBoxIcon.None:
                        msgicon = OLEMSGICON.OLEMSGICON_NOICON;
                        break;

                    case MessageBoxIcon.Hand:
                        msgicon = OLEMSGICON.OLEMSGICON_CRITICAL;
                        break;
                }

                uiShellService.ShowMessageBox(
                    0,
                    ref empty,
                    title,
                    string.IsNullOrEmpty(text) ? null : text,
                    helpKeyword,
                    0,
                    msgbtn,
                    OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
                    msgicon,
                    0,
                    out pnResult);
            }

            return (DialogResult)pnResult;
        }

Same methods

VsShellHelper::ShowMessageBox ( string title, string text, string helpKeyword ) : DialogResult
VsShellHelper