public string[] GetRequiredAssembliesFromSource(string[] sources)
{
if(sources == null || sources.Length <= 0)
return null;
var namespaces = new List<string>();
foreach(var line in sources)
{
//Filter for using statements
var matches = Regex.Matches(line, @"using ([^;]+);");
foreach(Match match in matches)
{
string foundNamespace = match.Groups[1].Value;
if(!namespaces.Contains(foundNamespace))
{
namespaces.Add(foundNamespace);
}
}
}
return namespaces.ToArray();
}