Exemplo n.º 1
0
 public void RegisterAsyncJsObject(string name, object objectToBind, bool camelCaseJavascriptNames = true)
 {
     if (IsBrowserInitialized)
     {
         throw new Exception("Browser is already initialized. RegisterJsObject must be" +
                             "called before the underlying CEF browser is created.");
     }
     managedCefBrowserAdapter.RegisterAsyncJsObject(name, objectToBind, camelCaseJavascriptNames);
 }
Exemplo n.º 2
0
 /// <summary>
 /// <para>Asynchronously registers a Javascript object in this specific browser instance.</para>
 /// <para>Only methods of the object will be availabe.</para>
 /// </summary>
 /// <param name="name">The name of the object. (e.g. "foo", if you want the object to be accessible as window.foo).</param>
 /// <param name="objectToBind">The object to be made accessible to Javascript.</param>
 /// <param name="options">binding options - camelCaseJavascriptNames default to true </param>
 /// <exception cref="System.Exception">Browser is already initialized. RegisterJsObject must be +
 ///                                     called before the underlying CEF browser is created.</exception>
 /// <remarks>The registered methods can only be called in an async way, they will all return immeditaly and the resulting
 /// object will be a standard javascript Promise object which is usable to wait for completion or failure.</remarks>
 public void RegisterAsyncJsObject(string name, object objectToBind, BindingOptions options = null)
 {
     if (IsBrowserInitialized)
     {
         throw new Exception("Browser is already initialized. RegisterJsObject must be" +
                             "called before the underlying CEF browser is created.");
     }
     managedCefBrowserAdapter.RegisterAsyncJsObject(name, objectToBind, options);
 }