protected void EnlistTestFile(string fileName, string code, bool parseFile)
        {
            ResourceResolverService.SetFileContentUnitTestOnly(fileName, code);
            ProjectFileDictionaryService.AddFile(fileName, this.Project);

            if (parseFile)
            {
                IParser parser = ResourceResolverService.GetParser(fileName);
                Assert.IsNotNull(parser, "Could not get parser for " + fileName + ".");
                ICompilationUnit cu = parser.Parse(this.DefaultProjectContent, fileName, code);
                cu.Freeze();
                Assert.IsFalse(cu.ErrorsDuringCompile, "Errors while parsing test program.");
                ParserService.RegisterParseInformation(fileName, cu);
                this.DefaultProjectContent.UpdateCompilationUnit(null, cu, fileName);
            }
        }
 static void AddFilesFromProject(IList <string> files, IProject p)
 {
     foreach (ProjectItem pi in p.Items)
     {
         if (pi is FileProjectItem)
         {
             string name = pi.FileName;
             if (IsPossibleFile(name))
             {
                 files.Add(name);
                 // Add the file to the project dictionary here.
                 // This saves the lookup time when the corresponding project
                 // is needed later.
                 ProjectFileDictionaryService.AddFile(name, p);
             }
         }
     }
 }