public HomeWindow(Lifetime lifetime, TutorialWindowManager windowManager, IShellLocks shellLocks, IUIApplication environment, IActionManager actionManager, TabbedToolWindowClass toolWindowClass, IWindowsHookManager windowsHookManager, IColorThemeManager colorThemeManager) { _windowManager = windowManager; _lifetime = lifetime; _shellLocks = shellLocks; _colorThemeManager = colorThemeManager; _toolWindowClass = toolWindowClass; _htmlGenerator = new HtmlGenerator(lifetime, colorThemeManager); var toolWindowInstance = _toolWindowClass.RegisterInstance( lifetime, 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.AddBracket( () => _viewControl = viewControl, () => _viewControl = null); lt.AddBracket( () => _containerControl.Controls.Add(_viewControl), () => _containerControl.Controls.Remove(_viewControl)); _htmlMediator = new HtmlMediator(lifetime, this); _colorThemeManager.ColorThemeChanged.Advise(lifetime, RefreshKeepContent); SetColors(); return(new EitherControl(lt, containerControl)); }); toolWindowInstance.Title.Value = "Home"; }
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; }
public SampleToolWindow(Lifetime lifetime, ToolWindowManager toolWindowManager, SampleToolWindowDescriptor sampleToolWindowDescriptor, ISettingsStore settingsStore, IColorThemeManager colorThemeManager) { _toolWindowClass = toolWindowManager.Classes[sampleToolWindowDescriptor] as TabbedToolWindowClass; if (_toolWindowClass == null) { throw new ApplicationException("ToolWindowClass"); } _toolWindowInstance = _toolWindowClass.RegisterInstance(lifetime, "Sample Tool Window", null, (lt, twi) => { twi.QueryClose.Value = true; var toolPanel = new ToolPanel(); // Tool Window var toolwndView = new ToolWindowView(); var toolwndViewTab = new TabItem { Content = toolwndView, Header = toolwndView.Name }; toolPanel.tabControl.Items.Add(toolwndViewTab); // Options var optionsPageViewModel = new OptionsPageViewModel(lt, settingsStore); var optionsPageView = new OptionsPageView { DataContext = optionsPageViewModel }; var optionsPageViewTab = new TabItem { Content = optionsPageView, Header = optionsPageView.Name }; toolPanel.tabControl.Items.Add(optionsPageViewTab); // Actions var actionsViewModel = new ActionsViewModel(lt); var actionsView = new ActionsView { DataContext = actionsViewModel }; var actionsViewTab = new TabItem { Content = actionsView, Header = actionsView.Name }; toolPanel.tabControl.Items.Add(actionsViewTab); // PSI Navigation var psiNavigationViewModel = new PsiNavigationViewModel(lt); var psiNavigationView = new PsiNavigationView { DataContext = psiNavigationViewModel }; var psiNavigationViewTab = new TabItem { Content = psiNavigationView, Header = psiNavigationView.Name }; toolPanel.tabControl.Items.Add(psiNavigationViewTab); // Context Action var contextActionView = new ToLowerCaseContextActionView(); var contextActionViewTab = new TabItem { Content = contextActionView, Header = contextActionView.Name }; toolPanel.tabControl.Items.Add(contextActionViewTab); // Quick Fix var quickFixView = new CorrectBadWordQuickFixView(); var quickFixViewTab = new TabItem { Content = quickFixView, Header = quickFixView.Name }; toolPanel.tabControl.Items.Add(quickFixViewTab); // Element Problem Analyzer and Code Highlighting var problemAnalyzerView = new BadWordNamingView(); var problemAnalyzerViewTab = new TabItem { Content = problemAnalyzerView, Header = problemAnalyzerView.Name }; toolPanel.tabControl.Items.Add(problemAnalyzerViewTab); // Solution Component var solcompView = new SolutionComponentView(); var solcompViewTab = new TabItem { Content = solcompView, Header = solcompView.Name }; toolPanel.tabControl.Items.Add(solcompViewTab); // Signals var sigViewModel = new SignalsViewModel(lt); var sigView = new SignalsView { DataContext = sigViewModel }; var sigViewTab = new TabItem { Content = sigView, Header = sigView.Name }; toolPanel.tabControl.Items.Add(sigViewTab); // IProperty var propViewModel = new PropertyViewModel(lt); var propView = new PropertyView { DataContext = propViewModel }; var propViewTab = new TabItem { Content = propView, Header = propView.Name }; toolPanel.tabControl.Items.Add(propViewTab); // UI Themes var uithemeViewModel = new UiThemeViewModel(lt, colorThemeManager); var uithemeView = new UiThemeView { DataContext = uithemeViewModel }; var uithemeViewTab = new TabItem { Content = uithemeView, Header = uithemeView.Name }; toolPanel.tabControl.Items.Add(uithemeViewTab); return(new EitherControl(lt, toolPanel)); }); }