Beispiel #1
0
        public fWebBrowser(fWManager f, int IdWindowManager, bool IsPopupWnd, string urlpopup)
        {
            InitializeComponent();

            this.fWmag = f;
            this.IdWindow = IdWindowManager;

            if (IsPopupWnd==true)
            {
                web_view = new WebView(urlpopup, new BrowserSettings());
                web_view.Dock = DockStyle.Fill;
                web_view.LifeSpanHandler = this;

                //BrowserSettings s = new BrowserSettings();

                this.panBrowser.Controls.Add(web_view);

                var presenter = new ExamplePresenter(web_view, this,
                    invoke => Invoke(invoke));
            }
            else
            {
                web_view = new WebView("https://www.google.com", new BrowserSettings());
                web_view.Dock = DockStyle.Fill;
                web_view.LifeSpanHandler = this;

                this.panBrowser.Controls.Add(web_view);

                var presenter = new ExamplePresenter(web_view, this,
                    invoke => Invoke(invoke));
            }
        }
Beispiel #2
0
        public Browser()
        {
            InitializeComponent();
            Text = "CefSharp";

            web_view = new WebView("https://github.com/ataranto/CefSharp", new BrowserSettings());
            web_view.Dock = DockStyle.Fill;
            toolStripContainer.ContentPanel.Controls.Add(web_view);

            var presenter = new ExamplePresenter(web_view, this,
                invoke => Invoke(invoke));
        }
Beispiel #3
0
        public MainWindow()
        {
            InitializeComponent();

            web_view.DownloadHandler = new DownloadHandler();
            var presenter = new ExamplePresenter(web_view, this,
                invoke => Dispatcher.BeginInvoke(invoke));

            handlers = new Dictionary<object, EventHandler>
            {
                // file
                { showDevToolsMenuItem, ShowDevToolsActivated},
                { closeDevToolsMenuItem, CloseDevToolsActivated},
                { exitMenuItem, ExitActivated },

                // edit
                { undoMenuItem, UndoActivated },
                { redoMenuItem, RedoActivated },
                { cutMenuItem, CutActivated },
                { copyMenuItem, CopyActivated },
                { pasteMenuItem, PasteActivated },
                { deleteMenuItem, DeleteActivated },
                { selectAllMenuItem, SelectAllActivated },

                // test
                { testResourceLoadMenuItem, TestResourceLoadActivated },
                { testSchemeLoadMenuItem, TestSchemeLoadActivated },
                { testExecuteScriptMenuItem, TestExecuteScriptActivated },
                { testEvaluateScriptMenuItem, TestEvaluateScriptActivated },
                { testBindMenuItem, TestBindActivated },
                { testConsoleMessageMenuItem, TestConsoleMessageActivated },
                { testTooltipMenuItem, TestTooltipActivated },
                { testPopupMenuItem, TestPopupActivated },
                { testLoadStringMenuItem, TestLoadStringActivated },
                { testCookieVisitorMenuItem, TestCookieVisitorActivated },

                // navigation
                { backButton, BackActivated },
                { forwardButton, ForwardActivated },
            };
        }