public static void ShowErrorMessage(string message, string title)
 {
     VsShellUtilities.ShowMessageBox(
         ServiceLocator.GetServiceProvider(),
         message,
         title,
         OLEMSGICON.OLEMSGICON_CRITICAL,
         OLEMSGBUTTON.OLEMSGBUTTON_OK,
         OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
 }
        public static bool?ShowQueryMessage(string message, string title, bool showCancelButton)
        {
            int result = VsShellUtilities.ShowMessageBox(
                ServiceLocator.GetServiceProvider(),
                message,
                title,
                OLEMSGICON.OLEMSGICON_QUERY,
                showCancelButton ? OLEMSGBUTTON.OLEMSGBUTTON_YESNOCANCEL : OLEMSGBUTTON.OLEMSGBUTTON_YESNO,
                OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);

            if (result == NativeMethods.IDCANCEL)
            {
                return(null);
            }
            return(result == NativeMethods.IDYES);
        }