GetMapper() public method

public GetMapper ( IJSObservableBridge root ) : IJavascriptObjectInternalMapper
root IJSObservableBridge
return IJavascriptObjectInternalMapper
Esempio n. 1
0
        private async Task <IJavascriptObject> InjectInHTMLSession(IJSCSGlue iroot)
        {
            if (iroot == null)
            {
                return(null);
            }

            switch (iroot.Type)
            {
            case JsCsGlueType.Basic:
                return(null);

            case JsCsGlueType.Object:
                if ((iroot.JSValue.IsNull))
                {
                    return(null);
                }
                break;
            }

            var jvm = _SessionCache.GetMapper(iroot as IJSObservableBridge);
            var res = _sessionInjector.Inject(iroot.JSValue, jvm);

            if ((iroot.CValue != null) && (res == null))
            {
                throw ExceptionHelper.GetUnexpected();
            }

            await jvm.UpdateTask;

            return(res);
        }
Esempio n. 2
0
        private async Task <IJavascriptObject> InjectInHTMLSession(IJSCSGlue iroot)
        {
            if ((iroot == null) || (iroot.IsBasic()))
            {
                return(null);
            }

            var jvm = _SessionCache.GetMapper(iroot as IJSObservableBridge);
            var res = _sessionInjector.Inject(iroot.JSValue, jvm);

            if ((iroot.CValue != null) && (res == null))
            {
                throw ExceptionHelper.GetUnexpected();
            }

            await jvm.UpdateTask;

            return(res);
        }
Esempio n. 3
0
        private async Task <IJavascriptObject> InjectInHtmlSession(IJsCsGlue root)
        {
            if (!Context.JavascriptFrameworkIsMappingObject)
            {
                return(root?.JsValue);
            }

            if ((root == null) || (root.IsBasic()))
            {
                return(null);
            }

            var jvm = _SessionCache.GetMapper(root as IJsCsMappedBridge);
            var res = _SessionInjector.Inject(root.JsValue, jvm);

            if ((root.CValue != null) && (res == null))
            {
                throw ExceptionHelper.GetUnexpected();
            }

            await jvm.UpdateTask;

            return(res);
        }