/// <summary>
 /// Invokes CSExecutor (C# script engine)
 /// </summary>
 public void Execute(PrintDelegate print, string[] args, bool rethrow)
 {
     // AppInfo.appName = new FileInfo(Application.ExecutablePath).Name;
     CSExecutor exec = new CSExecutor();
     exec.Rethrow = rethrow;
     exec.Execute(args, print != null ? print : DefaultPrint);
 }
        //Keep For Later Investigations! - Ashly

        //private Dictionary<string, string> ScriptList;
        ///// <summary>
        ///// This will get the Script Listing and Convert it to a Dictonary for later use.
        ///// </summary>
        //public void GetScriptList()
        //{
        //    DirectoryInfo di = new DirectoryInfo("Scripts/");
        //    FileInfo[] aoscripts = di.GetFiles("*.cs");

        //    foreach (FileInfo fi in aoscripts)
        //    {
        //        ScriptList.Add("ScriptName", fi.Name);
        //    }
        //}
        //public void InitalizeScripts()
        //{

        //}

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        private static void Main(string[] args)
        {
            // AppInfo.appName = new FileInfo(Application.ExecutablePath).Name;

            CSExecutor exec = new CSExecutor();
            exec.Execute(args, Print);
        }
        /// <summary>
        /// Invokes CSExecutor (C# script engine)
        /// </summary>
        public static void Execute(PrintDelegate print, string[] args)
        {
            // AppInfo.appName = exename;
            CSExecutor exec = new CSExecutor();

            exec.Rethrow = Rethrow;
            exec.Execute(args, print != null ? print : DefaultPrint);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Compiles script into assembly with CSExecutor and loads it in current AppDomain
        /// </summary>
        /// <param name="scriptFile">The name of script file to be compiled.</param>
        /// <param name="assemblyFile">The name of compiled assembly. If set to null a temnporary file name will be used.</param>
        /// <param name="debugBuild">true if debug information should be included in assembly; otherwise, false.</param>
        /// <returns></returns>
        public static Assembly Load(string scriptFile, string assemblyFile, bool debugBuild)
        {
            CSExecutor exec = new CSExecutor();

            exec.Rethrow = true;
            string outputFile = exec.Compile(scriptFile, assemblyFile, debugBuild);

            AssemblyName asmName = AssemblyName.GetAssemblyName(outputFile);

            return(AppDomain.CurrentDomain.Load(asmName));
        }
 /// <summary>
 /// Compiles script into assembly with CSExecutor
 /// </summary>
 /// <param name="scriptFile">The name of script file to be compiled.</param>
 /// <param name="assemblyFile">The name of compiled assembly. If set to null a temnporary file name will be used.</param>
 /// <param name="debugBuild">true if debug information should be included in assembly; otherwise, false.</param>
 /// <returns></returns>
 public static string Compile(string scriptFile, string assemblyFile, bool debugBuild)
 {
     CSExecutor exec = new CSExecutor();
     exec.Rethrow = true;
     return exec.Compile(scriptFile, assemblyFile, debugBuild);
 }
        /// <summary>
        /// Compiles script into assembly with CSExecutor and loads it in current AppDomain
        /// </summary>
        /// <param name="scriptFile">The name of script file to be compiled.</param>
        /// <param name="assemblyFile">The name of compiled assembly. If set to null a temnporary file name will be used.</param>
        /// <param name="debugBuild">true if debug information should be included in assembly; otherwise, false.</param>
        /// <returns></returns>
        public static Assembly Load(string scriptFile, string assemblyFile, bool debugBuild)
        {
            CSExecutor exec = new CSExecutor();
            exec.Rethrow = true;
            string outputFile = exec.Compile(scriptFile, assemblyFile, debugBuild);

            AssemblyName asmName = AssemblyName.GetAssemblyName(outputFile);
            return AppDomain.CurrentDomain.Load(asmName);
        }