private JSGenericObject(CefV8CompleteContext context, CefV8Value value) { JSValue = value; _MappedJSValue = value; CValue = null; _CefV8Context = context; }
public CSharpToJavascriptMapper(CefV8CompleteContext context, IJSOLocalBuilder Builder, IJSCBridgeCache icacher) { _CefV8Context = context; _IJSOBuilder = Builder; _Cacher = icacher; _Basic = new BasicCSharpToJavascriptConverter(_CefV8Context); }
public static void Bind(this CefV8Value @this, string functionname, CefV8CompleteContext iCefV8Context, Action<string, CefV8Value, CefV8Value[]> iaction) { iCefV8Context.RunAsync(() => { var function = CefV8Value.CreateFunction(functionname, new CefV8Handler_Action(iaction)); @this.SetValue(functionname, function, CefV8PropertyAttribute.None); }); }
public static Task<CefV8Value> InvokeAsync(this CefV8Value @this, string functionname, CefV8CompleteContext context, params CefV8Value[] args) { return context.EvaluateAsync(() => { var fn = @this.GetValue(functionname); if ((fn==null) || !fn.IsFunction) return CefV8Value.CreateUndefined(); return fn.ExecuteFunction(@this, args); } ); }
internal JavascriptSessionInjector(CefV8CompleteContext iWebView, IJSOBuilder iGlobalBuilder, IJavascriptListener iJavascriptListener) { _CefV8Context = iWebView; _GlobalBuilder = iGlobalBuilder; _IJavascriptListener = iJavascriptListener; if (_IJavascriptListener != null) { _Listener = _GlobalBuilder.CreateJSO(); _Listener.Bind("TrackChanges",_CefV8Context, (c, o, e) => _IJavascriptListener.OnJavaScriptObjectChanges(e[0], e[1].GetStringValue(), e[2])); _Listener.Bind("TrackCollectionChanges", _CefV8Context, (c, o, e) => _IJavascriptListener.OnJavaScriptCollectionChanges(e[0], e[1].GetArrayElements(), e[2].GetArrayElements(), e[3].GetArrayElements())); } else _Listener = _GlobalBuilder.CreateJSO(); }
internal BidirectionalMapper(object iRoot, CefV8CompleteContext iwebview, JavascriptBindingMode iMode, object iadd) { _V8Context = iwebview; _LocalBuilder = new LocalBuilder(iwebview); _JSObjectBuilder = new CSharpToJavascriptMapper(iwebview, _LocalBuilder, this); _JavascriptToCSharpMapper = new JavascriptToCSharpMapper(); _Root = _JSObjectBuilder.Map(iRoot, iadd); _UnrootedEntities = new List<IJSCSGlue>(); _BindingMode = iMode; IJavascriptListener JavascriptObjecChanges = null; if (iMode == JavascriptBindingMode.TwoWay) JavascriptObjecChanges = this; _GlobalBuilder = new GlobalBuilder(_V8Context, "MVVMGlue"); _SessionInjector = new JavascriptSessionInjector(iwebview, _GlobalBuilder, JavascriptObjecChanges); }
public JSArray(CefV8CompleteContext context, IEnumerable<IJSCSGlue> values, IEnumerable collection, Type ElementType) { var dest = values.Select(v => v.JSValue).ToList(); _CefV8Context = context; var res = _CefV8Context.Evaluate(() => { CefV8Value myres = CefV8Value.CreateArray(dest.Count); dest.ForEach((el, i) => myres.SetValue(i, el)); return myres; }); JSValue = res; Items = new List<IJSCSGlue>(values); CValue = collection; IndividualType = ElementType; }
public JSCommand(CefV8CompleteContext iCefV8Context, IJSOBuilder builder, ICommand icValue) { _CefV8Context = iCefV8Context; _Command = icValue; bool canexecute = true; try { canexecute = _Command.CanExecute(null); } catch { } JSValue = _CefV8Context.Evaluate(() => { //_CefV8Context.Enter(); CefV8Value res = builder.CreateJSO(); res.SetValue("CanExecuteValue", CefV8Value.CreateBool(canexecute),CefV8PropertyAttribute.None); res.SetValue("CanExecuteCount", CefV8Value.CreateInt(_Count), CefV8PropertyAttribute.None); //_CefV8Context.Exit(); return res; }); //.Result; }
public JSGenericObject(CefV8CompleteContext context, CefV8Value value, object icValue) { JSValue = value; CValue = icValue; _CefV8Context = context; }
internal StringBinding(CefV8CompleteContext context, CefV8Value root, JavascriptSessionInjector iJavascriptSessionInjector) { _JavascriptSessionInjector = iJavascriptSessionInjector; _Context = context; _Root = root; }
public GlobalBuilder(CefV8CompleteContext iWebView, string iNameScape) { _CefV8Context = iWebView; _NameScape = iNameScape; }
public static CefV8Value Invoke(this CefV8Value @this, string functionname, CefV8CompleteContext iCefV8Context, params CefV8Value[] args) { return @this.InvokeAsync(functionname, iCefV8Context, args).Result; }
private HTML_Binding(CefV8CompleteContext iContext, BidirectionalMapper iConvertToJSO) { _CefV8Context = iContext; _BirectionalMapper = iConvertToJSO; }
public JSResultCommand(CefV8CompleteContext ijsobject, IJSOBuilder builder, IResultCommand icValue) { _CefV8Context = ijsobject; _JSResultCommand = icValue; JSValue = builder.CreateJSO(); }
public LocalBuilder(CefV8CompleteContext iIWebView) { _CefV8Context = iIWebView; }
public JSSimpleCommand(CefV8CompleteContext iCefV8Context, IJSOBuilder builder, ISimpleCommand icValue) { _CefV8Context = iCefV8Context; _JSSimpleCommand = icValue; JSValue = builder.CreateJSO(); }
public static JSGenericObject CreateNull(CefV8CompleteContext context, IJSOLocalBuilder builder) { return new JSGenericObject(context, builder.CreateNull()); }
public TestCefGlueWindow(CefFrame iFrame, CefV8CompleteContext iContext) { _CefFrame = iFrame; _CefV8Context = iContext.Context; }