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;
}