Ejemplo n.º 1
0
        public Test_ConvertToJSO()
        { 
            _WebView = WebCore.CreateWebView(500, 500, WebViewType.Offscreen);
            _IJSOBuilder = new LocalBuilder(_WebView);
            _ICSharpMapper = Substitute.For<IJSCBridgeCache>();
            _ICSharpMapper.GetCached(Arg.Any<object>()).Returns((IJSCSGlue)null);
            _ConverTOJSO = new CSharpToJavascriptMapper(_IJSOBuilder, _ICSharpMapper);
            _Test = new Test { S1 = "string", I1 = 25 };
            _Tests = new List<Test>();
            _Tests.Add(new Test() { S1 = "string1", I1 = 1 });
            _Tests.Add(new Test() { 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]);
        }
        internal BidirectionalMapper(object iRoot, IWebView iwebview, JavascriptBindingMode iMode, object iadd)
        {
            _IWebView = iwebview;
            _LocalBuilder = new LocalBuilder(iwebview);
            _JSObjectBuilder = new CSharpToJavascriptMapper(_LocalBuilder, this);
            _JavascriptToCSharpMapper = new JavascriptToCSharpMapper(iwebview);
            _Root = _JSObjectBuilder.Map(iRoot, iadd);
            _UnrootedEntities = new List<IJSCSGlue>();
            _BindingMode = iMode;

            IJavascriptListener JavascriptObjecChanges = null;
            if (iMode == JavascriptBindingMode.TwoWay)
                JavascriptObjecChanges = this;

            _GlobalBuilder = new GlobalBuilder(_IWebView, "MVVMGlue");

            _SessionInjector = new JavascriptSessionInjector(iwebview, _GlobalBuilder, JavascriptObjecChanges);
        }
Ejemplo n.º 3
0
        internal BidirectionalMapper(object iRoot, IWebView iwebview, JavascriptBindingMode iMode, object iadd)
        {
            _IWebView                 = iwebview;
            _LocalBuilder             = new LocalBuilder(iwebview);
            _JSObjectBuilder          = new CSharpToJavascriptMapper(_LocalBuilder, this);
            _JavascriptToCSharpMapper = new JavascriptToCSharpMapper(iwebview);
            _Root             = _JSObjectBuilder.Map(iRoot, iadd);
            _UnrootedEntities = new List <IJSCSGlue>();
            _BindingMode      = iMode;

            IJavascriptListener JavascriptObjecChanges = null;

            if (iMode == JavascriptBindingMode.TwoWay)
            {
                JavascriptObjecChanges = this;
            }

            _GlobalBuilder = new GlobalBuilder(_IWebView, "MVVMGlue");

            _SessionInjector = new JavascriptSessionInjector(iwebview, _GlobalBuilder, JavascriptObjecChanges);
        }