Reset() public method

public Reset ( ) : bool
return bool
        private void Execute(object sender, EventArgs e)
        {
            string message = "This will reset Web Extension Pack and restart Visual Studio.\r\n\r\nDo you wish to continue?";

            var answer = VsShellUtilities.ShowMessageBox(
                ServiceProvider,
                message,
                Vsix.Name,
                OLEMSGICON.OLEMSGICON_QUERY,
                OLEMSGBUTTON.OLEMSGBUTTON_OKCANCEL,
                OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);

            if (answer == (int)MessageBoxResult.OK)
            {
                var store = new DataStore();

                if (store.Reset())
                {
                    IVsShell4 shell = (IVsShell4)ServiceProvider.GetService(typeof(SVsShell));
                    shell.Restart((uint)__VSRESTARTTYPE.RESTART_Normal);
                }
                else
                {
                    var dte = (DTE2)ServiceProvider.GetService(typeof(DTE));
                    dte.StatusBar.Text = "An error occured. Please see output window for details.";
                }
            }
        }
Ejemplo n.º 2
0
        private void Execute(object sender, EventArgs e)
        {
            string message = "This will reset Web Extension Pack and restart Visual Studio.\r\n\r\nDo you wish to continue?";

            var answer = VsShellUtilities.ShowMessageBox(
                ServiceProvider,
                message,
                Vsix.Name,
                OLEMSGICON.OLEMSGICON_QUERY,
                OLEMSGBUTTON.OLEMSGBUTTON_OKCANCEL,
                OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);

            if (answer == (int)MessageBoxResult.OK)
            {
                var store = new DataStore();

                if (store.Reset())
                {
                    IVsShell4 shell = (IVsShell4)ServiceProvider.GetService(typeof(SVsShell));
                    shell.Restart((uint)__VSRESTARTTYPE.RESTART_Normal);
                }
                else
                {
                    var dte = (DTE2)ServiceProvider.GetService(typeof(DTE));
                    dte.StatusBar.Text = "An error occured. Please see output window for details.";
                }
            }
        }