Exemplo n.º 1
0
        public ExamplePresenter(IWebBrowser model, IExampleView view,
                                Action <Action> gui_invoke)
        {
            this.model      = model;
            this.view       = view;
            this.gui_invoke = gui_invoke;

            var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}",
                                        CEF.ChromiumVersion, CEF.CefVersion, CEF.CefSharpVersion);

            view.DisplayOutput(version);

            model.RequestHandler   = this;
            model.PropertyChanged += model_PropertyChanged;
            model.ConsoleMessage  += model_ConsoleMessage;

            // file
            view.ShowDevToolsActivated  += view_ShowDevToolsActivated;
            view.CloseDevToolsActivated += view_CloseDevToolsActivated;
            view.ExitActivated          += view_ExitActivated;

            // edit
            view.UndoActivated      += view_UndoActivated;
            view.RedoActivated      += view_RedoActivated;
            view.CutActivated       += view_CutActivated;
            view.CopyActivated      += view_CopyActivated;
            view.PasteActivated     += view_PasteActivated;
            view.DeleteActivated    += view_DeleteActivated;
            view.SelectAllActivated += view_SelectAllActivated;

            // test
            view.TestResourceLoadActivated   += view_TestResourceLoadActivated;
            view.TestSchemeLoadActivated     += view_TestSchemeLoadActivated;
            view.TestExecuteScriptActivated  += view_TestExecuteScriptActivated;
            view.TestEvaluateScriptActivated += view_TestEvaluateScriptActivated;
            view.TestBindActivated           += view_TestBindActivated;
            view.TestConsoleMessageActivated += view_TestConsoleMessageActivated;
            view.TestTooltipActivated        += view_TestTooltipActivated;
            view.TestPopupActivated          += view_TestPopupActivated;
            view.TestLoadStringActivated     += view_TestLoadStringActivated;
            view.TestCookieVisitorActivated  += view_TestCookieVisitorActivated;

            // navigation
            view.UrlActivated     += view_UrlActivated;
            view.ForwardActivated += view_ForwardActivated;
            view.BackActivated    += view_BackActivated;
        }
Exemplo n.º 2
0
        public ExamplePresenter(IWebBrowser model, IExampleView view,
            Action<Action> gui_invoke)
        {
            this.model = model;
            this.view = view;
            this.gui_invoke = gui_invoke;

            var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}",
                CEF.ChromiumVersion, CEF.CefVersion, CEF.CefSharpVersion);
            view.DisplayOutput(version);

            model.RequestHandler = this;
            model.PropertyChanged += model_PropertyChanged;
            model.ConsoleMessage += model_ConsoleMessage;
            //model.LifeSpanHandler = this;

            // file
            view.ShowDevToolsActivated += view_ShowDevToolsActivated;
            view.CloseDevToolsActivated += view_CloseDevToolsActivated;
            view.ExitActivated += view_ExitActivated;

            // edit
            view.UndoActivated += view_UndoActivated;
            view.RedoActivated += view_RedoActivated;
            view.CutActivated += view_CutActivated;
            view.CopyActivated += view_CopyActivated;
            view.PasteActivated += view_PasteActivated;
            view.DeleteActivated += view_DeleteActivated;
            view.SelectAllActivated +=  view_SelectAllActivated;

            // test
            view.TestResourceLoadActivated += view_TestResourceLoadActivated;
            view.TestSchemeLoadActivated += view_TestSchemeLoadActivated;
            view.TestExecuteScriptActivated += view_TestExecuteScriptActivated;
            view.TestEvaluateScriptActivated += view_TestEvaluateScriptActivated;
            view.TestBindActivated += view_TestBindActivated;
            view.TestConsoleMessageActivated += view_TestConsoleMessageActivated;
            view.TestTooltipActivated += view_TestTooltipActivated;
            view.TestPopupActivated += view_TestPopupActivated;
            view.TestLoadStringActivated += view_TestLoadStringActivated;
            view.TestCookieVisitorActivated += view_TestCookieVisitorActivated;

            // navigation
            view.UrlActivated += view_UrlActivated;
            view.ForwardActivated += view_ForwardActivated;
            view.BackActivated += view_BackActivated;
        }
Exemplo n.º 3
0
 private void model_ConsoleMessage(object sender, ConsoleMessageEventArgs e)
 {
     gui_invoke(() => view.DisplayOutput(e.Message));
 }