public List<FoundTileInfo> GetTiles(string directoryName, string fileExtension) { DirectoryInfo directory = new DirectoryInfo(directoryName); var files = directory.GetFiles("*" + fileExtension); List<FoundTileInfo> foundIndexes = new List<FoundTileInfo>(); foreach (var file in files) { TileIndex id; if (TryParse(file.Name, out id)) { FoundTileInfo info = new FoundTileInfo { ID = id, Path = file.Name }; foundIndexes.Add(info); } } return foundIndexes; }
public List <FoundTileInfo> GetTiles(string directoryName, string fileExtension) { DirectoryInfo directory = new DirectoryInfo(directoryName); var files = directory.GetFiles("*" + fileExtension); List <FoundTileInfo> foundIndexes = new List <FoundTileInfo>(); foreach (var file in files) { TileIndex id; if (TryParse(file.Name, out id)) { FoundTileInfo info = new FoundTileInfo { ID = id, Path = file.Name }; foundIndexes.Add(info); } } return(foundIndexes); }