private void OnButtonNextStepClick(object o, EventArgs e)
 {
     if (CheckRequiredFields())
     {
         NextStep?.Invoke();
     }
 }
예제 #2
0
        protected override void OnCompleted(IShellResult result)
        {
            Helper.ThrowIf <TypescriptNotInstalledException>(result.Error);

            logger.Debug("Typescript is installed");

            NextStep?.Invoke();
        }
예제 #3
0
 private void btn_NextStepClick(object o, EventArgs e)
 {
     if (checkRequiredFields())
     {
         NextStep?.Invoke();
     }
     else
     {
         this.LabelMessageRequiredFields.Visible = true;
     }
 }
예제 #4
0
        public override void Run()
        {
            logger.Debug("Creating a temporary folder for the compiling...");

            var temps = Directory.GetDirectories(CurrentDirectory).Where(X => X.Contains("temp"));
            var nxt   = temps.Count() + 1;
            var name  = $"temp{nxt}";
            var path  = Path.Combine(CurrentDirectory, name);

            Directory.CreateDirectory(path);


            logger.Debug("tempory folder created");

            NextStep?.Invoke();
        }
예제 #5
0
        public TutorialWindow(string contentPath, Lifetime tutorialLifetime, TutorialWindowManager windowManager,
                              ISolution solution, IPsiFiles psiFiles,
                              ChangeManager changeManager, TextControlManager textControlManager, IShellLocks shellLocks,
                              IEditorManager editorManager,
                              DocumentManager documentManager, IUIApplication environment, IActionManager actionManager,
                              TabbedToolWindowClass toolWindowClass,
                              WindowsHookManager windowsHookManager,
                              IColorThemeManager colorThemeManager)
        {
            _windowManager     = windowManager;
            _htmlGenerator     = new HtmlGenerator(tutorialLifetime, colorThemeManager);
            _tutorialLifetime  = tutorialLifetime;
            _shellLocks        = shellLocks;
            _colorThemeManager = colorThemeManager;

            if (!solution.GetComponent <ISolutionOwner>().IsRealSolutionOwner)
            {
                return;
            }

            _toolWindowInstance = toolWindowClass.RegisterInstance(
                tutorialLifetime, null, null,
                (lt, twi) =>
            {
                twi.QueryClose.Value = true;

                var containerControl = new TutorialPanel(environment).BindToLifetime(lt);

                var viewControl = new HtmlViewControl(windowsHookManager, actionManager)
                {
                    Dock = DockStyle.Fill,
                    WebBrowserShortcutsEnabled = false
                }.BindToLifetime(lt);

                var webControlHandler = new WebBrowserHostUiHandler(viewControl)
                {
                    Flags = HostUIFlags.DPI_AWARE,
                    IsWebBrowserContextMenuEnabled = false
                };

                lt.AddBracket(
                    () => _containerControl = containerControl,
                    () => _containerControl = null);

                lt.AddAction(() => _progressBar = null);

                lt.AddBracket(
                    () => _viewControl = viewControl,
                    () => _viewControl = null);

                lt.AddBracket(
                    () =>
                {
                    _containerControl.Controls.Add(_viewControl);
                    _containerControl.Controls.Add(_progressBar);
                },
                    () =>
                {
                    _containerControl.Controls.Remove(_viewControl);
                    _containerControl.Controls.Remove(_progressBar);
                });

                _colorThemeManager.ColorThemeChanged.Advise(tutorialLifetime, RefreshKeepContent);

                SetColors();

                _htmlMediator = new HtmlMediator(tutorialLifetime, this);
                _htmlMediator.OnNextStepButtonClick.Advise(tutorialLifetime,
                                                           () => NextStep?.Invoke(null, EventArgs.Empty));
                _htmlMediator.OnRunStepNavigationLinkClick.Advise(tutorialLifetime, NavigateToCodeByLink);

                var focusTracker = new WindowFocusTracker(tutorialLifetime);
                focusTracker.IsFocusOnEditor.Change.Advise(tutorialLifetime,
                                                           () => _htmlMediator.ChangeNextStepButtonText(focusTracker.IsFocusOnEditor.Value));

                _htmlMediator.OnPageHasFullyLoaded.Advise(tutorialLifetime,
                                                          () => { _htmlMediator.ChangeNextStepButtonText(focusTracker.IsFocusOnEditor.Value); });

                return(new EitherControl(lt, containerControl));
            });

            _stepPresenter = new TutorialStepPresenter(this, contentPath, tutorialLifetime, solution, psiFiles,
                                                       changeManager,
                                                       textControlManager, shellLocks, editorManager, documentManager, environment, actionManager);

            _toolWindowInstance.Title.Value = _stepPresenter.Title;
        }
예제 #6
0
 protected override void OnCompleted(IShellResult result)
 {
     logger.Debug("Installed typescript");
     NextStep?.Invoke();
 }
예제 #7
0
        protected override void OnCompleted(IShellResult result)
        {
            Helper.ThrowIf(result.Error, "Failed to install typescript");

            NextStep?.Invoke();
        }
 private void NextStepClick(object sender, MouseButtonEventArgs e)
 {
     NextStep?.Invoke(this);
 }