Yaircc.ThemeManager.WebView_PropertyChanged C# (CSharp) Method

WebView_PropertyChanged() private method

Handles the PropertyChanged event of CefSharp.WinForms.WebView.
private WebView_PropertyChanged ( object sender, System e ) : void
sender object The source of the event.
e System The event arguments.
return void
        private void WebView_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            // Once the browser is initialised, load the HTML for the tab.
            if (!this.webViewIsReady)
            {
                if (e.PropertyName.Equals("IsBrowserInitialized", StringComparison.OrdinalIgnoreCase))
                {
                    this.webViewIsReady = this.WebView.IsBrowserInitialized;
                    if (this.webViewIsReady)
                    {
                        string resourceName = "Yaircc.UI.ThemeSample.htm";
                        using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
                        {
                            using (StreamReader reader = new StreamReader(stream))
                            {
                                this.WebView.LoadHtml(reader.ReadToEnd());
                            }
                        }
                    }
                }
            }

            // Once the HTML has finished loading, begin loading the initial content.
            if (e.PropertyName.Equals("IsLoading", StringComparison.OrdinalIgnoreCase))
            {
                if (!this.WebView.IsLoading && this.pendingTheme != null)
                {
                    this.LoadThemePreview(this.pendingTheme);
                }
            }
        }