Ejemplo n.º 1
0
        /// <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, null);

            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;
                }
            }
        }