ApplyJavascriptBindings() public static méthode

public static ApplyJavascriptBindings ( IJavascriptObjectRepository repository ) : void
repository IJavascriptObjectRepository
Résultat void
Exemple #1
0
        public OffScreenBrowser(string address, int width, int height)
            : base(
                address,
                new BrowserSettings()
        {
            DefaultEncoding = "UTF-8"
        }
                )
        {
            _paintBufferLock = new ReaderWriterLockSlim();

            Size          = new System.Drawing.Size(width, height);
            RenderHandler = this;

            Util.ApplyJavascriptBindings(JavascriptObjectRepository);
        }
Exemple #2
0
        public MainForm()
        {
            Instance = this;
            InitializeComponent();

            try
            {
                var location = Assembly.GetExecutingAssembly().Location;
                var icon     = Icon.ExtractAssociatedIcon(location);
                Icon          = icon;
                TrayIcon.Icon = icon;
            }
            catch
            {
            }

            Browser = new ChromiumWebBrowser(
                Path.Combine(Program.BaseDirectory, "html/index.html")
                )
            {
                DragHandler     = new NoopDragHandler(),
                MenuHandler     = new CustomMenuHandler(),
                BrowserSettings =
                {
                    DefaultEncoding = "UTF-8",
                },
                Dock = DockStyle.Fill
            };

            Browser.IsBrowserInitializedChanged += (A, B) =>
            {
                // Browser.ShowDevTools();
            };

            Util.ApplyJavascriptBindings(Browser.JavascriptObjectRepository);

            Controls.Add(Browser);
        }