Exemplo n.º 1
0
        public static void OpenTutorialSolution(SolutionStateTracker solutionStateTracker, int id)
        {
            var globalSettings = GlobalSettings.Instance;

            VsIntegration.CloseVsSolution();
            solutionStateTracker.NotifyAgreeToRunTutorial();
            SolutionCopyHelper.CleanUpDirectory(globalSettings.GetPath(id, PathType.WorkCopySolutionFolder));
            SolutionCopyHelper.CopySolution(globalSettings.GetPath(id, PathType.BaseSolutionFolder),
                                            globalSettings.GetPath(id, PathType.WorkCopySolutionFolder));
            VsIntegration.OpenVsSolution(globalSettings.GetPath(id, PathType.WorkCopySolutionFile));
        }
Exemplo n.º 2
0
        public TutorialWindowManager(Lifetime shellLifetime, SolutionStateTracker solutionStateTracker,
                                     GlobalSettings globalSettings,
                                     IShellLocks shellLocks, ToolWindowManager toolWindowManager, TutorialWindowDescriptor toolWindowDescriptor,
                                     IUIApplication environment, IActionManager actionManager, IWindowsHookManager windowsHookManager,
                                     IColorThemeManager colorThemeManager, IThreading threading)
        {
            _shellLifetime        = shellLifetime;
            _solutionStateTracker = solutionStateTracker;
            _globalSettings       = globalSettings;
            _shellLocks           = shellLocks;
            _environment          = environment;
            _actionManager        = actionManager;
            _windowsHookManager   = windowsHookManager;
            _colorThemeManager    = colorThemeManager;
            _threading            = threading;

            _runningTutorial = 0;

            _toolWindowClass = toolWindowManager.Classes[toolWindowDescriptor] as TabbedToolWindowClass;
            if (_toolWindowClass == null)
            {
                throw new ApplicationException("Expected tabbed tool window");
            }

            _toolWindowClass.QueryCloseInstances.Advise(shellLifetime, args =>
            {
                if (_runningTutorial == 0)
                {
                    return;
                }
                if (!_tutorialWindow.IsLastStep)
                {
                    args.Cancel = !MessageBox.ShowYesNo(
                        "This will close the tutorial solution as well. Tutorial progress will be lost. Close the tutorial?",
                        "ReSharper Tutorials");
                    if (args.Cancel)
                    {
                        return;
                    }
                }
                VsIntegration.CloseVsSolution(true);
            });
        }
Exemplo n.º 3
0
 public void CloseSolution()
 {
     VsIntegration.CloseVsSolution(true);
 }
Exemplo n.º 4
0
 public void Close(object sender, RoutedEventArgs args)
 {
     VsIntegration.CloseVsSolution(true);
 }