コード例 #1
0
        /// <summary>
        /// 获得引擎
        /// </summary>
        /// <returns></returns>
        private Microsoft.ClearScript.V8.V8ScriptEngine GetEngine()
        {
            var result = new Microsoft.ClearScript.V8.V8ScriptEngine();

            result.AddHostType("Console", typeof(Console));
            return(result);
        }
コード例 #2
0
 protected override void InnerEmbedHostType(string itemName, Type type)
 {
     try
     {
         _jsEngine.AddHostType(itemName, type);
     }
     catch (OriginalException e)
     {
         throw WrapScriptEngineException(e);
     }
     catch (OriginalInterruptedException e)
     {
         throw WrapScriptInterruptedException(e);
     }
 }