Exemple #1
0
        internal JsContext(int id, JsEngine engine, IntPtr engineHandle, Action <int> notifyDispose)
        {
            _id            = id;
            _engine        = engine;
            _notifyDispose = notifyDispose;

            _keepalives = new KeepAliveDictionaryStore();
            _context    = jscontext_new(id, engineHandle);
            _convert    = new JsConvert(this);
        }
Exemple #2
0
        public JsEngine()
        {
            _keepalives = new KeepAliveDictionaryStore();

            _keepalive_remove             = new KeepaliveRemoveDelegate(KeepAliveRemove);
            _keepalive_get_property_value = new KeepAliveGetPropertyValueDelegate(KeepAliveGetPropertyValue);
            _keepalive_set_property_value = new KeepAliveSetPropertyValueDelegate(KeepAliveSetPropertyValue);
            _keepalive_invoke             = new KeepAliveInvokeDelegate(KeepAliveInvoke);

            _engine = new HandleRef(this, jsengine_new(
                                        _keepalive_remove,
                                        _keepalive_get_property_value, _keepalive_set_property_value,
                                        _keepalive_invoke));

            _convert = new JsConvert(this);
        }
Exemple #3
0
        internal JsContext(int id,
                           JsEngine engine,
                           HandleRef engineHandle,
                           Action <int> notifyDispose,
                           JsTypeDefinitionBuilder jsTypeDefBuilder)
        {
            _id            = id;
            _engine        = engine;
            _notifyDispose = notifyDispose;

            _keepalives = new KeepAliveDictionaryStore();
            _context    = new HandleRef(this, jscontext_new(id, engineHandle));
            _convert    = new JsConvert(this);

            this.jsTypeDefBuilder = jsTypeDefBuilder;

            engineMethodCallbackDel = new ManagedMethodCallDel(EngineListener_MethodCall);
            NativeV8JsInterOp.CtxRegisterManagedMethodCall(this, engineMethodCallbackDel);
            registerMethods.Add(null);    //first is null
            registerProperties.Add(null); //first is null


            proxyStore = new NativeObjectProxyStore(this);
        }