示例#1
0
        public void SetResultObj(object result)
        {
            JsValue output = new JsValue();

            this.context.Converter.AnyToJsValue(result, ref output);
            NativeV8JsInterOp.ResultSetValue(metArgsPtr, ref output);
        }
示例#2
0
        public void SetResultAutoWrap <T>(T result)
            where T : class, new()
        {
            Type              actualType = result.GetType();
            JsTypeDefinition  jsTypeDef  = this.context.GetJsTypeDefinition(actualType);
            INativeScriptable proxy      = this.context.CreateWrapper(result, jsTypeDef);
            JsValue           output     = new JsValue();

            this.context.Converter.ToJsValue(proxy, ref output);
            NativeV8JsInterOp.ResultSetValue(metArgsPtr, ref output);
        }
示例#3
0
        public void SetResultObj(object result, JsTypeDefinition jsTypeDef)
        {
            if (!jsTypeDef.IsRegisterd)
            {
                this.context.RegisterTypeDefinition(jsTypeDef);
            }

            INativeScriptable proxy  = this.context.CreateWrapper(result, jsTypeDef);
            JsValue           output = new JsValue();

            this.context.Converter.ToJsValue(proxy, ref output);
            NativeV8JsInterOp.ResultSetValue(metArgsPtr, ref output);
        }