예제 #1
0
 public void RegisterJsObject(string name, object objectToBind, bool camelCaseJavascriptNames = true)
 {
     if (browserInitialized)
     {
         throw new Exception("Browser is already initialized. RegisterJsObject must be" +
                             "called before the underlying CEF browser is created.");
     }
     managedCefBrowserAdapter.RegisterJsObject(name, objectToBind, camelCaseJavascriptNames);
 }
예제 #2
0
        /// <summary>
        /// Registers a Javascript object in this specific browser instance.
        /// </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>
        public void RegisterJsObject(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.");
            }

            //Enable WCF if not already enabled
            CefSharpSettings.WcfEnabled = true;

            managedCefBrowserAdapter.RegisterJsObject(name, objectToBind, options);
        }
예제 #3
0
 public void RegisterJsObject(string name, object objectToBind)
 {
     managedCefBrowserAdapter.RegisterJsObject(name, objectToBind);
 }
예제 #4
0
 public void RegisterJsObject(string name, object objectToBind, bool camelCaseJavascriptNames = true)
 {
     managedCefBrowserAdapter.RegisterJsObject(name, objectToBind, camelCaseJavascriptNames);
 }