private CompilerResults FromDomBatch(CompilerParameters options, CodeCompileUnit[] ea)
{
if (options == null)
{
throw new ArgumentNullException(nameof(options));
}
if (ea == null)
{
throw new ArgumentNullException(nameof(ea));
}
string[] filenames = new string[ea.Length];
for (int i = 0; i < ea.Length; i++)
{
if (ea[i] == null)
{
continue; // the other two batch methods just work if one element is null, so we'll match that.
}
ResolveReferencedAssemblies(options, ea[i]);
filenames[i] = options.TempFiles.AddExtension(i + FileExtension);
using (var fs = new FileStream(filenames[i], FileMode.Create, FileAccess.Write, FileShare.Read))
using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8))
{
((ICodeGenerator)this).GenerateCodeFromCompileUnit(ea[i], sw, Options);
sw.Flush();
}
}
return FromFileBatch(options, filenames);
}