コード例 #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
ファイル: JsPool.cs プロジェクト: modulexcite/JSPool
		/// <summary>
		/// Creates a new JavaScript engine and adds it to the list of all available engines.
		/// </summary>
		protected virtual IJsEngine CreateEngine()
		{
			var engine = _engineFactory();
			_config.Initializer(engine);
			_metadata[engine] = new EngineMetadata();
			Interlocked.Increment(ref _engineCount);
			return engine;
		}
コード例 #4
0
ファイル: JsPool.cs プロジェクト: RichardD012/JSPool
 /// <summary>
 /// Creates a new JavaScript engine and adds it to the list of all available engines.
 /// </summary>
 protected virtual IJsEngine CreateEngine()
 {
     var engine = _engineFactory();
     _config.Initializer(engine);
     _metadata[engine] = new EngineMetadata();
     return engine;
 }