/// <summary> /// Loads the assemblies from a package /// </summary> /// <remarks> /// Loads the assemblies from a package. This is equivalent /// to passing the -pkg: command line flag to the C# compiler /// on the command line. /// </remarks> static public void LoadPackage(string pkg) { if (pkg == null) { Error.WriteLine("Invalid package specified"); return; } string pkgout = Driver.GetPackageFlags(pkg, false, RootContext.ToplevelTypes.Compiler.Report); if (pkgout == null) { return; } string [] xargs = pkgout.Trim(new Char [] { ' ', '\n', '\r', '\t' }). Split(new Char [] { ' ', '\t' }); foreach (string s in xargs) { if (s.StartsWith("-r:") || s.StartsWith("/r:") || s.StartsWith("/reference:")) { string lib = s.Substring(s.IndexOf(':') + 1); Evaluator.LoadAssembly(lib); continue; } } }
/// <summary> /// Loads the assembly /// </summary> /// <remarks> /// Loads the specified assembly and makes its types /// available to the evaluator. This is equivalent /// to passing the -pkg: command line flag to the C# /// compiler on the command line. /// </remarks> static public void LoadAssembly(string assembly) { Evaluator.LoadAssembly(assembly); }