コード例 #1
0
        /// <summary>
        /// Creates a new JavaScript engine and adds it to the list of all available engines.
        /// </summary>
        protected virtual T CreateEngine()
        {
            var engine = _engineFactory();

            _config.Initializer(engine);
            _metadata[engine] = new EngineMetadata();
            return(engine);
        }
コード例 #2
0
        /// <summary>
        /// Creates a new JavaScript engine and adds it to the list of all available engines.
        /// </summary>
        protected virtual TPooled CreateEngine()
        {
            var engine = new TPooled
            {
                InnerEngine = _engineFactory(),
            };

            engine.ReturnEngineToPool = () => ReturnEngineToPoolInternal(engine);
            _config.Initializer(engine.InnerEngine);
            _metadata[engine] = new EngineMetadata();
            return(engine);
        }
コード例 #3
0
        /// <summary>
        /// Creates a new JavaScript engine and adds it to the list of all available engines.
        /// </summary>
        protected virtual TPooled CreateEngine()
        {
            var engine = new TPooled
            {
                InnerEngine = _engineFactory(),
            };

            engine.ReturnEngineToPool = () => ReturnEngineToPoolInternal(engine);
            _config.Initializer(engine.InnerEngine);
            _registeredEngines.TryAdd(engine, 0);
            return(engine);
        }