Example #1
0
        private Task InjectInHTLMSession(IJSCSGlue iroot, bool isroot = false)
        {
            if ((iroot == null) || (iroot.Type == JSCSGlueType.Basic))
            {
                return(TaskHelper.Ended());
            }

            var jvm = new JavascriptMapper(iroot as IJSObservableBridge, this);
            var res = _SessionInjector.Map(iroot.JSValue, jvm, (iroot.CValue != null));

            if (!isroot)
            {
                return(jvm.UpdateTask);
            }
            else
            {
                return(jvm.UpdateTask.ContinueWith(_ => _SessionInjector.RegisterInSession(res),
                                                   TaskScheduler.FromCurrentSynchronizationContext()));
            }
        }
        private async Task InjectInHTLMSession(IJSCSGlue iroot, bool isroot = false)
        {
            if ((iroot == null) || (iroot.Type == JSCSGlueType.Basic))
            {
                return;
            }

            if ((iroot.Type == JSCSGlueType.Object) && (iroot.JSValue.IsNull))
            {
                return;
            }

            var jvm = new JavascriptMapper(iroot as IJSObservableBridge, this);
            var res = _SessionInjector.Map(iroot.JSValue, jvm, (iroot.CValue != null));

            await jvm.UpdateTask;

            if (isroot)
            {
                await _SessionInjector.RegisterInSession(res);
            }
        }
        private async Task InjectInHTLMSession(IJSCSGlue iroot, bool isroot = false)
        {
            if ((iroot == null) || (iroot.Type == JSCSGlueType.Basic))
                return;

            if ((iroot.Type == JSCSGlueType.Object) && (iroot.JSValue.IsNull))
                return;

            var jvm = new JavascriptMapper(iroot as IJSObservableBridge, this);
            var res = _SessionInjector.Map(iroot.JSValue, jvm, (iroot.CValue != null));

            await jvm.UpdateTask;

            if (isroot)
                await _SessionInjector.RegisterInSession(res);
        }
        private Task InjectInHTLMSession(IJSCSGlue iroot, bool isroot = false)
        {
            if ((iroot == null) || (iroot.Type == JSCSGlueType.Basic))
            {
                return TaskHelper.Ended();
            }

            var jvm = new JavascriptMapper(iroot as IJSObservableBridge, this);
            var res = _SessionInjector.Map(iroot.JSValue, jvm,(iroot.CValue!=null));
            if (!isroot)
                return jvm.UpdateTask;
            else
                return jvm.UpdateTask.ContinueWith(_ => _SessionInjector.RegisterInSession(res),
                            TaskScheduler.FromCurrentSynchronizationContext());
        }