private static CoverageInfo JoinCoverageFiles(ArrayList files)
{
CoverageInfo result = null;
CoverageInfo current;
CoverageInfo joined = null;
if (files != null)
{
foreach (string[] file in files)
{
// Create from the current file
foreach (string filename in file)
{
try
{
current = CoverageInfo.CreateFromFile(filename);
}
catch (InvalidCoverageFileException ex)
{
continue;
}
catch (FileNotFoundException ex)
{
continue;
}
if (result == null)
{
// First time through, assign to result
result = current;
continue;
}
// Not the first time through, join the result with the current
try
{
joined = CoverageInfo.Join(result, current);
}
catch (Exception ex)
{
continue;
}
finally
{
// Dispose current and result
current.Dispose();
current = null;
}
result = joined;
}
}
}
return result;
}