public override IList <TileEngine.Files.FileInfo> GetFileInfos(string dir) { List <TileEngine.Files.FileInfo> list = new List <TileEngine.Files.FileInfo>(); foreach (var d in Directory.GetDirectories(dir)) { DirectoryInfo di = new DirectoryInfo(d); var fi = new TileEngine.Files.FileInfo() { Path = d, Name = Path.GetFileName(d), Directory = Path.GetDirectoryName(d), IsDirectory = true, Size = 0, Date = di.LastWriteTime }; list.Add(fi); } foreach (var f in Directory.GetFiles(dir)) { var fi = new System.IO.FileInfo(f); var fin = new TileEngine.Files.FileInfo() { Path = f, Name = Path.GetFileName(f), Directory = Path.GetDirectoryName(f), IsDirectory = false, Size = fi.Length, Date = fi.LastWriteTime }; list.Add(fin); } return(list); }
public override IList <TileEngine.Files.FileInfo> GetVolumeInfos() { List <TileEngine.Files.FileInfo> list = new List <TileEngine.Files.FileInfo>(); string docs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var fi = new TileEngine.Files.FileInfo() { Path = docs, Name = "My Documents", IsDirectory = true, Size = 0, Date = DateTime.Now }; list.Add(fi); foreach (var d in Directory.GetLogicalDrives()) { DirectoryInfo di = new DirectoryInfo(d); fi = new TileEngine.Files.FileInfo() { Path = d, Name = d, IsDirectory = true, Size = 0, Date = di.LastWriteTime }; list.Add(fi); } return(list); }
public override IList <TileEngine.Files.FileInfo> GetVolumeInfos() { List <TileEngine.Files.FileInfo> list = new List <TileEngine.Files.FileInfo>(); foreach (var d in Directory.GetLogicalDrives()) { DirectoryInfo di = new DirectoryInfo(d); var fi = new TileEngine.Files.FileInfo() { Path = d, Name = d, IsDirectory = true, Size = 0, Date = di.LastWriteTime }; list.Add(fi); } return(list); }