public static void GetFiles(List<object> data, Purpose purpose)
{
DirectoryInfo dir = null;
string[] allowed = null;
switch (purpose)
{
case Purpose.Info:
dir = new DirectoryInfo(Resources.ContentDirectory);
allowed = ContentExtensions;
break;
case Purpose.Game:
dir = new DirectoryInfo(Resources.GameDirectory);
allowed = GameExtensions;
break;
default:
return;
}
foreach (var f in dir.GetFiles().Where(f => allowed.Contains(f.Extension)))
{
Console.Write(purpose + " filename = " + f.Name);
// append the filename, and filesize to the builder
data.Add(f.Name);
Console.WriteLine(" length = " +f.Length);
data.Add(f.Length);
}
}