public IJavascriptObject ExecuteFunction(IWebView webViewGeneric, IJavascriptObject context, params IJavascriptObject[] parameters)
        {
            var webView = webViewGeneric as AwesomiumWebView;

            if (webView == null)
            {
                return(null);
            }

            return(new JSValue_JavascriptObject(webView.ExecuteFunction(_JSValue, context.Convert(), parameters.Select(el => el.Convert()).ToArray())));
        }
Esempio n. 2
0
        public IJavascriptObject ExecuteFunction(IWebView context)
        {
            var webView = context as AwesomiumWebView;

            if (context == null)
            {
                return(null);
            }

            return(new JSValue_JavascriptObject(webView.ExecuteFunction(_JSValue)));
        }
        public void ExecuteFunctionNoResult(IWebView webViewGeneric, IJavascriptObject context, params IJavascriptObject[] parameters)
        {
            var webView = webViewGeneric as AwesomiumWebView;

            if (webView == null)
            {
                return;
            }

            var realContext = (context != null) ? context.Convert() : (JSValue) new JSObject();

            webView.ExecuteFunction(_JSValue, realContext, parameters.Select(el => el.Convert()).ToArray());
        }
Esempio n. 4
0
 public Task <IJavascriptObject> InvokeAsync(string iFunctionName, IWebView iContext, params IJavascriptObject[] iparam)
 {
     return(Task.FromResult(Invoke(iFunctionName, iContext, iparam)));
 }
Esempio n. 5
0
        public IJavascriptObject Invoke(string iFunctionName, IWebView context, params IJavascriptObject[] iparam)
        {
            var res = ((JSObject)_JSValue).Invoke(iFunctionName, iparam.Select(c => c.Convert()).ToArray());

            return(res.Convert());
        }
Esempio n. 6
0
        public void Bind(string iFunctionName, IWebView iContext, Action <string, IJavascriptObject, IJavascriptObject[]> action)
        {
            JSObject ob = _JSValue;

            ob.Bind(iFunctionName, false, (o, e) => { action(iFunctionName, null, e.Arguments.Select(el => el.Convert()).ToArray()); });
        }
 public void InvokeNoResult(string iFunctionName, IWebView context, params IJavascriptObject[] iparam)
 {
     ((JSObject)_JSValue).Invoke(iFunctionName, iparam.Select(c => c.Convert()).ToArray());
 }
 public void Bind(string iFunctionName, IWebView iContext, Action<string, IJavascriptObject, IJavascriptObject[]> action)
 {
     JSObject ob = _JSValue;
     ob.Bind(iFunctionName, false, (o, e) => { action(iFunctionName, null, e.Arguments.Select(el => el.Convert()).ToArray()); });
 }
 public Task<IJavascriptObject> InvokeAsync(string iFunctionName, IWebView iContext, params IJavascriptObject[] iparam)
 {
     return Task.FromResult(Invoke(iFunctionName, iContext, iparam));
 }
 public IJavascriptObject Invoke(string iFunctionName, IWebView context, params IJavascriptObject[] iparam)
 {
     var res = ((JSObject)_JSValue).Invoke(iFunctionName, iparam.Select(c => c.Convert()).ToArray());
     return res.Convert();
 }
        public IJavascriptObject ExecuteFunction(IWebView context)
        {
            var webView = context as AwesomiumWebView;
            if (context == null)
                return null;

            return new JSValue_JavascriptObject(webView.ExecuteFunction(_JSValue));
        }
        public void BindArguments(string functionName, IWebView webView, Action <IJavascriptObject, IJavascriptObject, IJavascriptObject, IJavascriptObject> action)
        {
            Action <string, IJavascriptObject, IJavascriptObject[]> neededAction = (_, __, arg) => action(arg[0], arg[1], arg[2], arg[3]);

            Bind(functionName, webView, neededAction);
        }
        public void Bind(string functionName, IWebView webView, Action <IJavascriptObject[]> action)
        {
            Action <string, IJavascriptObject, IJavascriptObject[]> neededAction = (_, __, arg) => action(arg);

            Bind(functionName, webView, neededAction);
        }