public TutorialWindowRunner([NotNull] Lifetime lifetime, ISolution solution, IPsiFiles psiFiles, ChangeManager changeManager, [NotNull] ISolutionStateTracker solutionStateTracker, [NotNull] GlobalSettings globalSettings, TextControlManager textControlManager, IShellLocks shellLocks, IEditorManager editorManager, DocumentManager documentManager, IUIApplication environment, IActionManager actionManager, WindowsHookManager windowsHookManager, IPsiServices psiServices, IActionShortcuts shortcutManager, IColorThemeManager colorThemeManager, IThreading threading) { if (lifetime == null) { throw new ArgumentNullException("lifetime"); } if (solutionStateTracker == null) { throw new ArgumentNullException("solutionStateTracker"); } if (globalSettings == null) { throw new ArgumentNullException("globalSettings"); } foreach (var tutorial in globalSettings.AvailableTutorials) { if (VsIntegration.GetCurrentSolutionPath() == tutorial.Value) { solutionStateTracker.AfterSolutionOpened.Advise(lifetime, () => RunTutorial(globalSettings, tutorial.Key, lifetime, solution, psiFiles, changeManager, textControlManager, shellLocks, editorManager, documentManager, environment, actionManager, windowsHookManager, psiServices, shortcutManager, colorThemeManager, threading)); } } }
public void NavigateStep13() { var dte = VsIntegration.GetCurrentVsInstance(); var path = GlobalSettings.Instance.GetPath(4, PathType.WorkCopySolutionFolder) + "\\Tutorial4_WhatsNewReSharper2017.1\\.editorconfig"; dte.ExecuteCommand("File.OpenFile", path); }
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)); }
public void ChangeNextStepButtonText(bool isFocusOnEditor) { if (!_isButtonTextChangeAllowed) { return; } var nextStepShortcut = VsIntegration.GetActionShortcut(GlobalSettings.NextStepShortcutAction); var args = new object[] { isFocusOnEditor, nextStepShortcut }; _viewControl.Document?.InvokeScript("setNextStepButtonText", args); }
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); }); }
public StepActionChecker(Lifetime lifetime, IShellLocks shellLocks, IPsiFiles psiFiles) { _shellLocks = shellLocks; _psiFiles = psiFiles; _vsInstance = VsIntegration.GetCurrentVsInstance(); var events2 = _vsInstance.Events as Events2; if (events2 == null) { return; } var commandEvents = events2.CommandEvents; lifetime.AddBracket( () => commandEvents.AfterExecute += CommandEventsOnAfterExecute, () => commandEvents.AfterExecute -= CommandEventsOnAfterExecute); OnCheckPass = new Signal <bool>(lifetime, "StepActionChecker.AfterActionApplied"); }
public NextStepShortcutChecker(Lifetime lifetime, TutorialStep step, string nextStepActionName) { _step = step; _nextStepActionName = nextStepActionName; _vsInstance = VsIntegration.GetCurrentVsInstance(); var events2 = _vsInstance.Events as Events2; if (events2 == null) { return; } var commandEvents = events2.CommandEvents; lifetime.AddBracket( () => commandEvents.BeforeExecute += CommandEventsOnBeforeExecute, () => { commandEvents.BeforeExecute -= CommandEventsOnBeforeExecute; }); }
public void CloseSolution() { VsIntegration.CloseVsSolution(true); }
public bool CheckStep19() { var dte = VsIntegration.GetCurrentVsInstance(); return(dte.ActiveDocument.Name == "GoToText.xml"); }
public void Close(object sender, RoutedEventArgs args) { VsIntegration.CloseVsSolution(true); }