Пример #1
0
        public static void Main()
        {
            var assemblyDir = System.IO.Path.GetDirectoryName(new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath);

            Environment.CurrentDirectory = System.IO.Path.Combine(assemblyDir, @"..\..\");

            if (CfxRuntime.PlatformArch == CfxPlatformArch.x64)
            {
                CfxRuntime.LibCefDirPath = @"cef\Release64";
            }
            else
            {
                CfxRuntime.LibCefDirPath = @"cef\Release";
            }

            Chromium.WebBrowser.ChromiumWebBrowser.OnBeforeCfxInitialize += ChromiumWebBrowser_OnBeforeCfxInitialize;
            ChromiumWebBrowser.OnBeforeCommandLineProcessing             += ChromiumWebBrowser_OnBeforeCommandLineProcessing;
            Chromium.WebBrowser.ChromiumWebBrowser.Initialize();

            //Walkthrough01.Main();
            //return;

            Application.EnableVisualStyles();
            var f = new BrowserForm();

            f.Show();
            Application.Run(f);

            CfxRuntime.Shutdown();
        }
Пример #2
0
        internal JsTestObject(BrowserForm form)
        {
            this.form = form;
            AddFunction("testFunction").Execute += TestFunction_Execute;
            AddObject("anotherObject").AddFunction("anotherTestFunction").Execute += AnotherTestFunction_Execute;

            var p = AddDynamicProperty("dynamicProperty");

            p.PropertyGet += dynamicProperty_PropertyGet;
            p.PropertySet += dynamicProperty_PropertySet;
        }