示例#1
0
        public static string Evaluate(string script, string scriptType, Hashtable variables)
        {
            MacroScriptEngine mse = new MacroScriptEngine(scriptType);

            mse.ScriptVariables = ConvertHashTable(variables);
            mse.Script          = script;
            return(mse.Evaluate());
        }
示例#2
0
 internal static MacroScriptEngine LoadEngineByFileExtension(string fileExtension)
 {
     MacroScriptEngine mse = new MacroScriptEngine();
     mse.loadRunTime();
     mse.m_engine = mse.m_runTime.GetEngineByFileExtension(fileExtension);
     mse.m_exceptionOperations = mse.m_engine.GetService<ExceptionOperations>();
     return mse;
 }
示例#3
0
 internal static MacroScriptEngine GetEngineByType(string scriptType)
 {
     MacroScriptEngine mse = new MacroScriptEngine();
     mse.loadRunTime();
     mse.m_engine = mse.m_runTime.GetEngine(scriptType);
     mse.m_exceptionOperations = mse.m_engine.GetService<ExceptionOperations>();
     return mse;
 }
示例#4
0
        internal static MacroScriptEngine GetEngineByType(string scriptType)
        {
            MacroScriptEngine mse = new MacroScriptEngine();

            mse.loadRunTime();
            mse.m_engine = mse.m_runTime.GetEngine(scriptType);
            mse.m_exceptionOperations = mse.m_engine.GetService <ExceptionOperations>();
            return(mse);
        }
示例#5
0
        internal static MacroScriptEngine LoadEngineByFileExtension(string fileExtension)
        {
            MacroScriptEngine mse = new MacroScriptEngine();

            mse.loadRunTime();
            mse.m_engine = mse.m_runTime.GetEngineByFileExtension(fileExtension);
            mse.m_exceptionOperations = mse.m_engine.GetService <ExceptionOperations>();
            return(mse);
        }
示例#6
0
        public static string ExecuteFile(string path, Hashtable variables)
        {
            string fileEnding = path.Substring(path.LastIndexOf('.')).Trim('.');

            MacroScriptEngine mse = MacroScriptEngine.LoadEngineByFileExtension(fileEnding);

            mse.ScriptVariables = ConvertHashTable(variables);

            return(mse.ExecuteFile(path));
        }