protected override void Init() { _ICSharpMapper = Substitute.For <IJavascriptSessionCache>(); _JSCommandFactory = Substitute.For <IJSCommandFactory>(); _ICSharpMapper.GetCached(Arg.Any <object>()).Returns((IJSCSGlue)null); _javascriptFrameworkManager = Substitute.For <IJavascriptFrameworkManager>(); _HTMLViewContext = new HTMLViewContext(_WebView, GetTestUIDispacther(), _javascriptFrameworkManager, null, _Logger); _ConverTOJSO = new CSharpToJavascriptConverter(_HTMLViewContext, _ICSharpMapper, _JSCommandFactory, _Logger); _Test = new TestClass { S1 = "string", I1 = 25 }; _Tests = new List <TestClass> { new TestClass() { S1 = "string1", I1 = 1 }, new TestClass() { S1 = "string2", I1 = 2 } }; _Test2 = new Test2() { T1 = _Test, T2 = _Test }; _Tests_NG = new ArrayList(); _Tests_NG.Add(_Tests[0]); _Tests_NG.Add(_Tests[0]); }
private JsGenericObject(HTMLViewContext context, IJavascriptObject value) { JSValue = value; _MappedJSValue = value; CValue = null; _HTMLViewContext = context; }
public JSArray(HTMLViewContext context, IEnumerable<IJSCSGlue> values, IEnumerable collection) { _HTMLViewContext = context; CValue = collection; Items = new List<IJSCSGlue>(values); var type = collection.GetElementType(); _IndividualType = WebView.Factory.IsTypeBasic(type) ? type : null; }
private HTML_Binding(BidirectionalMapper iConvertToJSO, IWebSessionLogger logger) { _Context = iConvertToJSO.Context; _BirectionalMapper = iConvertToJSO; _Logger = logger; _Bindings.Add(this); _Logger.Debug(() => $"HTML_Binding {_Current} created"); }
public JSArray(HTMLViewContext context, IEnumerable <IJSCSGlue> values, IEnumerable collection) { _HTMLViewContext = context; CValue = collection; Items = new List <IJSCSGlue>(values); var type = collection.GetElementType(); _IndividualType = WebView.Factory.IsTypeBasic(type) ? type : null; }
public JSArray(HTMLViewContext context, IEnumerable<IJSCSGlue> values, IEnumerable collection) { _HTMLViewContext = context; CValue = collection; Items = new List<IJSCSGlue>(values); var dest = values.Select(v => v.JSValue).ToList(); JSValue = WebView.Evaluate(() => WebView.Factory.CreateArray(dest)); var type = collection.GetElementType(); _IndividualType = WebView.Factory.IsTypeBasic(type) ? type : null; }
public JSCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ICommand command) { _JavascriptToCSharpConverter = converter; _HTMLViewContext = context; _Command = command; try { _InitialCanExecute = _Command.CanExecute(null); } catch { } }
public JSArray(HTMLViewContext context, IEnumerable <IJSCSGlue> values, IEnumerable collection) { _HTMLViewContext = context; CValue = collection; Items = new List <IJSCSGlue>(values); var dest = values.Select(v => v.JSValue).ToList(); JSValue = WebView.Evaluate(() => WebView.Factory.CreateArray(dest)); var type = collection.GetElementType(); _IndividualType = WebView.Factory.IsTypeBasic(type) ? type : null; }
protected override void Init() { _ICSharpMapper = Substitute.For <IJavascriptSessionCache>(); _GlueFactory = new GlueFactory(null, null); _ICSharpMapper.GetCached(Arg.Any <object>()).Returns((IJSCSGlue)null); _javascriptFrameworkManager = Substitute.For <IJavascriptFrameworkManager>(); _HTMLViewContext = new HTMLViewContext(WebBrowserWindow, GetTestUIDispacther(), _javascriptFrameworkManager, null, _Logger); _ConverTOJSO = new CSharpToJavascriptConverter(WebBrowserWindow, _ICSharpMapper, _GlueFactory, _Logger); _Test = new TestClass { S1 = "string", I1 = 25 }; _Tests = new List <TestClass> { new TestClass() { S1 = "string1", I1 = 1 }, new TestClass() { S1 = "string2", I1 = 2 } }; _Test2 = new Test2() { T1 = _Test, T2 = _Test }; _Tests_NG = new ArrayList(); _Tests_NG.Add(_Tests[0]); _Tests_NG.Add(_Tests[0]); _CircularSimple = new Circular1(); _CircularSimple.Reference = _CircularSimple; _CircularComplex = new Circular2(); var circularChild = new Circular2 { Reference = _CircularComplex }; _CircularComplex.List.Add(circularChild); }
public JSCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ICommand command) { _JavascriptToCSharpConverter = converter; _HTMLViewContext = context; _Command = command; var canexecute = true; try { canexecute = _Command.CanExecute(null); } catch { } JSValue = WebView.Evaluate(() => { var res = WebView.Factory.CreateObject(true); res.SetValue("CanExecuteValue", WebView.Factory.CreateBool(canexecute)); res.SetValue("CanExecuteCount", WebView.Factory.CreateInt(_Count)); return res; }); }
public JSCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ICommand command) { _JavascriptToCSharpConverter = converter; _HTMLViewContext = context; _Command = command; var canexecute = true; try { canexecute = _Command.CanExecute(null); } catch { } JSValue = WebView.Evaluate(() => { var res = WebView.Factory.CreateObject(true); res.SetValue("CanExecuteValue", WebView.Factory.CreateBool(canexecute)); res.SetValue("CanExecuteCount", WebView.Factory.CreateInt(_Count)); return(res); }); }
public static JsGenericObject CreateNull(HTMLViewContext context) { return(new JsGenericObject(context, context.WebView.Factory.CreateNull())); }
internal StringBinding(HTMLViewContext context, IJavascriptObject root) { _Context = context; _Root = root; }
public JsSimpleCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ISimpleCommand simpleCommand) { _HTMLViewContext = context; _JavascriptToCSharpConverter = converter; _JSSimpleCommand = simpleCommand; }
public JsResultCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, IResultCommand resultCommand) { _HTMLViewContext = context; _JavascriptToCSharpConverter = converter; _JSResultCommand = resultCommand; }
public JsMappableSimpleCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ISimpleCommand resultCommand) : base(context, converter, resultCommand) { }
public JsGenericObject(HTMLViewContext context, object icValue) { CValue = icValue; _HTMLViewContext = context; }
public GlueFactory(HTMLViewContext context, IJavascriptToCSharpConverter converter) { _HTMLViewContext = context; _JavascriptToCSharpConverter = converter; }
public JsGenericObject(HTMLViewContext context, IJavascriptObject value, object icValue) { JSValue = value; CValue = icValue; _HTMLViewContext = context; }
public static JsGenericObject CreateNull(HTMLViewContext context) { return new JsGenericObject(context, context.WebView.Factory.CreateNull()); }
public JSMappableCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ICommand command) : base(context, converter, command) { }