public MarkdownPreviewControl(MarkdownPreviewToolWindowPane toolWindowPane, IServiceProvider serviceProvider)
        {
            this.ToolWindowPane = toolWindowPane;

            IComponentModel componentModel = (IComponentModel)serviceProvider.GetService<SComponentModel>();
            this.ActiveViewTrackerService = componentModel.GetService<IActiveViewTrackerService>();
            this.BackgroundParserFactoryService = componentModel.GetService<IBackgroundParserFactoryService>();

            this.Browser = new WebBrowser();
            this.Browser.NavigateToString(EmptyWindowHtml);
            this.Browser.LoadCompleted += OnBrowserLoadCompleted;
            this.Content = this.Browser;

            this.ActiveViewTrackerService.ViewChanged += WeakEvents.AsWeak<ViewChangedEventArgs>(OnViewChanged, eh => this.ActiveViewTrackerService.ViewChanged -= eh);
        }
Exemplo n.º 2
0
        public MarkdownPreviewControl(MarkdownPreviewToolWindowPane toolWindowPane, IServiceProvider serviceProvider)
        {
            this.ToolWindowPane = toolWindowPane;

            IComponentModel componentModel = (IComponentModel)serviceProvider.GetService <SComponentModel>();

            this.ActiveViewTrackerService       = componentModel.GetService <IActiveViewTrackerService>();
            this.BackgroundParserFactoryService = componentModel.GetService <IBackgroundParserFactoryService>();

            this.Browser = new WebBrowser();
            this.Browser.NavigateToString(EmptyWindowHtml);
            this.Browser.LoadCompleted += OnBrowserLoadCompleted;
            this.Content = this.Browser;

            this.ActiveViewTrackerService.ViewChanged += WeakEvents.AsWeak <ViewChangedEventArgs>(OnViewChanged, eh => this.ActiveViewTrackerService.ViewChanged -= eh);
        }