instance of object with type definition
Inheritance: NativeRef, INativeScriptable
示例#1
0
        public NativeJsInstanceProxy CreateProxyForObject(object o, JsTypeDefinition jsTypeDefinition)
        {
            if (_createdWrappers.TryGetValue(o, out NativeJsInstanceProxy found))
            {
                return(found);
            }

            var proxyObject = new NativeJsInstanceProxy(
                _nativeRefList.Count,
                o,
                jsTypeDefinition);

            _nativeRefList.Add(proxyObject);
            _createdWrappers.Add(o, proxyObject);

            //register
            NativeV8JsInterOp.CreateNativePart(_ownerContext, proxyObject);
            return(proxyObject);
        }
        public NativeJsInstanceProxy CreateProxyForObject(object o, JsTypeDefinition jsTypeDefinition)
        {
            NativeJsInstanceProxy found;
            if (this.createdWrappers.TryGetValue(o, out found))
            {
                return found;
            }

            var proxyObject = new NativeJsInstanceProxy(
                nativeRefList.Count,
                o,
                jsTypeDefinition);

            nativeRefList.Add(proxyObject);
            this.createdWrappers.Add(o, proxyObject);

            //register
            NativeV8JsInterOp.CreateNativePart(ownerContext, proxyObject);
            return proxyObject;
        }