示例#1
0
        public static CodeProject CreateCodeProject(IEnumerable<string> codeFiles, string location, StyleCopEnvironment environment)
        {
            var codeProject = new CodeProject(Guid.NewGuid().GetHashCode(), location, new Configuration(new string[0]));

            foreach (string codeFile in codeFiles)
            {
                if (!File.Exists(codeFile))
                {
                    throw new FileNotFoundException("File " + codeFile + " not found.", codeFile);
                }

                environment.AddSourceCode(codeProject, Path.GetFullPath(codeFile), null);
            }

            return codeProject;
        }