Exemple #1
0
        private static Script createEmptyScript(ScriptContext context, string id)
        {
            Script s = context.CreateNewScript(Process.GetCurrentProcess().MainModule.FileName);
            s.Id = id;
            s.EngineVersion = context.CoreVersion.ToString();

            if (context.Compiler.DefaultNETVersion>new Version(3,5))
            {
                if (Environment.Version.Major >= 4)
                    s.NetVersion = "4.0.30319";
                else
                    s.NetVersion = "3.5";
            }
            else
                s.NetVersion = context.Compiler.DefaultNETVersion.ToString();

            return s;
        }
Exemple #2
0
 // If there were any references in the command line, load them
 private static void loadReferences(ScriptContext context, ICollection<IScriptAction> actions)
 {
     if (actions.Count > 0)
     {
         var script = context.CreateNewScript(null);
         script.Items.AddRange(actions);
         context.Initialize(script);
     }
 }