Example #1
0
 internal DirectoryFileInformation(DirectoryListItem directoryListItem)
 {
     FileName       = directoryListItem.Name;
     CreationTime   = directoryListItem.CreationTime;
     LastAccessTime = directoryListItem.CreationTime;
     LastWriteTime  = directoryListItem.CreationTime;
     IsDirectory    = directoryListItem.IsDirectory;
 }
Example #2
0
        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),
            });
        }