internal DirectoryFileInformation(DirectoryListItem directoryListItem) { FileName = directoryListItem.Name; CreationTime = directoryListItem.CreationTime; LastAccessTime = directoryListItem.CreationTime; LastWriteTime = directoryListItem.CreationTime; IsDirectory = directoryListItem.IsDirectory; }
DirectoryFileInformation GetDirectoryFileInformation(string parentDirectory, DirectoryListItem directoryListItem) { var path = parentDirectory + directoryListItem.Name; var lastWriteTime = directoryListItem.IsDirectory ? directoryListItem.CreationTime : GetCachedLastWriteTime(path) ?? directoryListItem.CreationTime; return(new DirectoryFileInformation(directoryListItem) { LastAccessTime = lastWriteTime, LastWriteTime = lastWriteTime, Length = directoryListItem.IsDirectory ? default(long) : GetCachedLength(path), }); }