public static ITaskProvider TransformPromiseToTask(this IJavascriptObject javascriptObjectPromise, IWebView webView) { var promiseHandler = new TaskToPromiseHandler(webView); javascriptObjectPromise.Invoke("then", webView, promiseHandler.Fufill); return(promiseHandler); }
public void MoveCollectionItem(IJavascriptObject array, IJavascriptObject item, int oldIndex, int newIndex) { _WebView.RunAsync(() => { array.Invoke("silentSplice", _WebView, _WebView.Factory.CreateInt(oldIndex), _WebView.Factory.CreateInt(1)); AddUnsafe(array, newIndex, 0, item); }); }
public void ClearAllCollection(IJavascriptObject array) { _WebView.RunAsync(() => { var length = array.GetArrayLength(); array.Invoke("silentSplice", _WebView, _WebView.Factory.CreateInt(0), _WebView.Factory.CreateInt(length)); }); }
public void Reroot(string PropertyName, IJSCSGlue newValue) { _Attributes[PropertyName] = newValue; IJavascriptObject silenter = null; if (_Silenters.TryGetValue(PropertyName, out silenter)) { silenter.InvokeAsync("silent", _CefV8Context, newValue.GetJSSessionValue()); } else { _CefV8Context.RunAsync(() => { var jso = _MappedJSValue; if (!_Silenters.TryGetValue(PropertyName, out silenter)) { silenter = jso.GetValue(PropertyName); _Silenters.Add(PropertyName, silenter); } silenter.Invoke("silent", _CefV8Context, newValue.GetJSSessionValue()); }); } }
protected int GetIntAttribute(IJavascriptObject value, string attibutename) { return(_WebView.Evaluate(() => value.Invoke(attibutename, _WebView).GetIntValue())); }
public Task <IJavascriptObject> GetAttributeAsync(IJavascriptObject value, string attributeName) { return(_WebView.EvaluateAsync(() => value.Invoke(attributeName, _WebView))); }
public bool GetBoolAttribute(IJavascriptObject value, string attibutename) { return(_WebView.Evaluate(() => value.Invoke(attibutename, _WebView).GetBoolValue())); }
public IJavascriptObject GetAttribute(IJavascriptObject value, string attibutename) { return(_WebView.Evaluate(() => value.Invoke(attibutename, _WebView))); }
protected IJavascriptObject CallWithRes(IJavascriptObject value, string functionname, params IJavascriptObject[] parameter) { return(_WebView.Evaluate(() => value.Invoke(functionname, _WebView, parameter))); }
public void SetAttribute(IJavascriptObject father, string attibutename, IJavascriptObject value) { _WebView.Evaluate(() => father.Invoke(attibutename, _WebView, value)); }
public bool GetBoolAttribute(IJavascriptObject value, string attibutename) { return _WebView.Evaluate(() => value.Invoke(attibutename, _WebView).GetBoolValue()); }
public double GetDoubleAttribute(IJavascriptObject value, string attibutename) { return _WebView.Evaluate(() => value.Invoke(attibutename, _WebView).GetDoubleValue()); }
public IJavascriptObject GetAttribute(IJavascriptObject value, string attibutename) { return _WebView.Evaluate(() => value.Invoke(attibutename, _WebView)); }
public Task SetAttributeAsync(IJavascriptObject father, string attributeName, IJavascriptObject value) { return(_WebView.EvaluateAsync(() => father.Invoke(attributeName, _WebView, value))); }
public string GetStringAttribute(IJavascriptObject value, string attributeName) { return(_WebView.Evaluate(() => value.Invoke(attributeName, _WebView).GetStringValue())); }
private void AddUnsafe(IJavascriptObject array, int index, int number, IJavascriptObject value) { array.Invoke("silentSplice", _WebView, _WebView.Factory.CreateInt(index), _WebView.Factory.CreateInt(number), value); InjectUnsafe(value); }
private void CanExecuteCommand(IJavascriptObject[] e, IJSCBridgeCache mapper) { bool res = _Command.CanExecute(GetArguments(mapper, e)); _MappedJSValue.Invoke("CanExecuteValue", _IWebView, _IWebView.Factory.CreateBool(res)); }
private void Silent(IJavascriptObject silenter, IJavascriptObject value) { silenter.Invoke("silent", _WebView, value); }
protected void Call(IJavascriptObject value, string functionname, Func <IJavascriptObject> parameter) { _WebView.Run(() => value.Invoke(functionname, _WebView, parameter())); }
public double GetDoubleAttribute(IJavascriptObject value, string attibutename) { return(_WebView.Evaluate(() => value.Invoke(attibutename, _WebView).GetDoubleValue())); }
protected async Task CallAsync(IJavascriptObject value, string functionName, params IJavascriptObject[] parameter) { await _WebView.RunAsync(() => value.Invoke(functionName, _WebView, parameter)); await WaitAnotherWebContextCycle(); }
protected async Task <IJavascriptObject> CallWithResAsync(IJavascriptObject value, string functionName, params IJavascriptObject[] parameter) { await WaitAnotherWebContextCycle(); return(await _WebView.EvaluateAsync(() => value.Invoke(functionName, _WebView, parameter))); }
protected void Call(IJavascriptObject value, string functionName, params IJavascriptObject[] parameter) { _WebView.Run(() => value.Invoke(functionName, _WebView, parameter)); }