Exemplo n.º 1
0
		public static void SetScriptErrorsSuppressed(WebBrowser browser, bool value)
		{
			browser.SetValue(ScriptErrorsSuppressedProperty, value);
		}
 public static void SetHtml(WebBrowser d, string value)
 {
     d.SetValue(HtmlProperty, value);
 }
        private static bool TryHookWebBrowser(WebBrowser webBrowser)
        {
            if (GetSuppressEraseBackground(webBrowser))
            {
                // Try to find the IE window several layers within the WebBrowser.
                IntPtr hwndIEWindow = GetIEWindow(webBrowser);
                if (hwndIEWindow != IntPtr.Zero)
                {
                    // Hook the window messages so we can intercept the
                    // WM_ERASEBKGND message.
                    IEWindowHook hook = new IEWindowHook(new HWND(hwndIEWindow));

                    // Keep our hook alive.
                    webBrowser.SetValue(SuppressEraseBackgroundWindowHookProperty, hook);

                    return true;
                }
            }

            return false;
        }
Exemplo n.º 4
0
 public static void SetUrl(WebBrowser d, string value) => d.SetValue(UrlProperty, value);
 /// <summary>
 ///     Attached property setter for the SuppressScriptErrors property.
 /// </summary>
 public static void SetSuppressScriptErrors(WebBrowser webBrowser, bool value)
 {
     webBrowser.SetValue(SuppressScriptErrorsProperty, value);
 }
        /// <summary>
        /// Generate right page
        /// </summary>
        /// <param name="pageNumber"></param>
        /// <returns>canvas, right canvas to renderBook()</returns>
        private Canvas generateRightCanvas(int pageNumber)
        {
            SolidColorBrush whiteBrush = new SolidColorBrush();
                whiteBrush.Color = Colors.White;
                Canvas canvas = new Canvas();
                canvas.Width = 520;
                canvas.Height = 720;
                canvas.Background = whiteBrush;
                canvas.Margin = new Thickness(520, 0, 0, 0);

                // Amu
                WebBrowser wbRightPage = new WebBrowser();

                // If there is odd number of pages last page in right will be empty (in future it will be filled with next chapter's first page)
                if (!(parser.pageCount < (pageNumber + 1)))
                {
                    wbRightPage.NavigateToString(splittedPages[pageNumber]);
                }
                wbRightPage.Width = 490;
                wbRightPage.Height = 700;
                wbRightPage.Margin = new Thickness(0, 8, 0, 0);
                wbRightPage.Foreground = new SolidColorBrush(Colors.Magenta);

                //   set the padding area to top and to left
                wbRightPage.SetValue(Canvas.LeftProperty, 20.00);
                wbRightPage.SetValue(Canvas.TopProperty, 50.00);
                canvas.Children.Add(wbRightPage);

                Rectangle rectangle = new Rectangle();
                rectangle.Width = 32;
                rectangle.Height = 720;
                rectangle.Fill = this.Resources["RightShadow"] as LinearGradientBrush;
                rectangle.Margin = new Thickness(0, 0, 0, 0);
                canvas.Children.Add(rectangle);

                return canvas;
        }
        /// <summary>
        /// Generate left page
        /// </summary>
        /// <param name="pageNumber"></param>
        /// <returns>canvas, left canvas to renderBook()</returns>
        private Canvas generateLeftCanvas(int pageNumber)
        {
            SolidColorBrush whiteBrush = new SolidColorBrush();
                whiteBrush.Color = Colors.White;
                Canvas canvas = new Canvas();
                canvas.Width = 520;
                canvas.Height = 720;
                canvas.Background = whiteBrush;
                canvas.Margin = new Thickness(0, 0, 0, 0);

                WebBrowser wbLeftPage = new WebBrowser();
                wbLeftPage.NavigateToString(splittedPages[pageNumber]);
                wbLeftPage.Width = 490;
                wbLeftPage.Height = 700;
                wbLeftPage.Margin = new Thickness(8, 8, 0, 0);
                wbLeftPage.Foreground = new SolidColorBrush(Colors.Magenta);

                // set the padding area to top and to left
                wbLeftPage.SetValue(Canvas.LeftProperty, 20.00);
                wbLeftPage.SetValue(Canvas.TopProperty, 50.00);

                canvas.Children.Add(wbLeftPage);

                Rectangle rectangle = new Rectangle();
                rectangle.Width = 32;
                rectangle.Height = 720;
                rectangle.Fill = this.Resources["LeftShadow"] as LinearGradientBrush;
                rectangle.Margin = new Thickness(490, 0, 0, 0);
                canvas.Children.Add(rectangle);

                return canvas;
        }
Exemplo n.º 8
0
 public static void SetWebContent(WebBrowser web_browser, Stream value) { web_browser.SetValue(WebContentProperty, value); }
 /// <summary>
 /// Sets the bind-able version of the source property.
 /// </summary>
 /// <param name="webBrowser">The web browser.</param>
 /// <param name="value">The source value.</param>
 public static void SetBindableSource(WebBrowser webBrowser, string value)
 {
     webBrowser.SetValue(BindableSourceProperty, value);
 }