Esempio n. 1
0
        public TutorialStepPresenter(IStepView view, string contentPath, Lifetime lifetime, ISolution solution, IPsiFiles psiFiles,
                                     TextControlManager textControlManager, IShellLocks shellLocks, IEditorManager editorManager,
                                     DocumentManager documentManager, IUIApplication environment, IActionManager actionManager,
                                     IPsiServices psiServices, IActionShortcuts shortcutManager)
        {
            _stepView          = view;
            Lifetime           = lifetime;
            Solution           = solution;
            PsiFiles           = psiFiles;
            TextControlManager = textControlManager;
            ShellLocks         = shellLocks;
            EditorManager      = editorManager;
            DocumentManager    = documentManager;
            Environment        = environment;
            ActionManager      = actionManager;
            _contentPath       = contentPath;
            _codeNavigator     = new SourceCodeNavigator(lifetime, solution, psiFiles, textControlManager, shellLocks, editorManager,
                                                         documentManager, environment);
            _steps = new Dictionary <int, TutorialStep>();
            _steps = TutorialXmlReader.ReadTutorialSteps(contentPath);

            _currentStepId = TutorialXmlReader.ReadCurrentStep(contentPath);
            CurrentStep    = _steps[_currentStepId];

            lifetime.AddBracket(
                () => { _stepView.NextStep += GoNext; },
                () => { _stepView.NextStep -= GoNext; });

            ProcessStep();
        }
Esempio n. 2
0
        public TutorialStepPresenter(IStepView view, string contentPath, Lifetime lifetime, ISolution solution,
                                     IPsiFiles psiFiles,
                                     ChangeManager changeManager, TextControlManager textControlManager, IShellLocks shellLocks,
                                     IEditorManager editorManager,
                                     DocumentManager documentManager, IUIApplication environment, IActionManager actionManager)
        {
            _stepView          = view;
            _lifetime          = lifetime;
            Solution           = solution;
            PsiFiles           = psiFiles;
            ChangeManager      = changeManager;
            TextControlManager = textControlManager;
            ShellLocks         = shellLocks;
            EditorManager      = editorManager;
            DocumentManager    = documentManager;
            Environment        = environment;
            ActionManager      = actionManager;
            _codeNavigator     = new SourceCodeNavigator(lifetime, solution, psiFiles, shellLocks,
                                                         editorManager,
                                                         documentManager);
            _steps = new Dictionary <int, TutorialStep>();

            var tutorialXmlReader = new TutorialXmlReader(actionManager);

            _steps = tutorialXmlReader.ReadTutorialSteps(contentPath);

            Title = TutorialXmlReader.ReadTitle(contentPath);

            //TODO: get rid of _currentStepId
            _currentStepId      = 1;
            CurrentStep         = _steps[_currentStepId];
            _stepView.StepCount = _steps.Count;

            lifetime.AddBracket(
                () => { _stepView.NextStep += StepOnStepIsDone; },
                () => { _stepView.NextStep -= StepOnStepIsDone; });

            ProcessCurrentStep();
        }