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; }
static void Main(string[] args) { Environment.CurrentDirectory = FileHelper.AppPath; CfxRuntime.LibCefDirPath = Path.GetFullPath($@"{_basePath}\{CfxRuntime.PlatformArch.ToString()}"); CfxRuntime.LibCfxDirPath = Path.GetFullPath($"{_basePath}"); if (!Directory.Exists(CfxRuntime.LibCefDirPath)) { throw new DirectoryNotFoundException("Sorry! The CEF configuration directory was not found. Please confirm and try again."); } ChromiumWebBrowser.OnBeforeCfxInitialize += new OnBeforeCfxInitializeEventHandler(ChromiumWebBrowser_OnBeforeCfxInitialize); ChromiumWebBrowser.OnBeforeCommandLineProcessing += new OnBeforeCommandLineProcessingEventHandler(ChromiumWebBrowser_OnBeforeCommandLineProcessing); ChromiumWebBrowser.Initialize(); Application.EnableVisualStyles(); var f = new BrowserForm(); f.Show(); Application.Run(f); CfxRuntime.Shutdown(); }