private static StorageEntryBase StorageProviderEntryFromFileInfo(FileInfo fileInfo) { StreamAttributes attr = 0; var fileAttr = fileInfo.Attributes; if (fileAttr.HasFlag(FileAttributes.Hidden)) { attr |= StreamAttributes.Hidden; } if (fileAttr.HasFlag(FileAttributes.System)) { attr |= StreamAttributes.System; } var ret = new StorageEntryBase() { Uri = new Uri(fileInfo.FullName), Attributes = attr, IsStorage = fileAttr.HasFlag(FileAttributes.Directory), Name = fileInfo.Name, LastWriteTime = fileInfo.LastWriteTime, Size = fileAttr.HasFlag(FileAttributes.Directory) ? 0 : fileInfo.Length }; return(ret); }
private StorageEntryBase StorageProviderEntryFromZipEntry(ZipArchiveEntry entry) { StreamAttributes attr = 0; var ret = new StorageEntryBase() { Uri = PathToUri(entry.FullName), Attributes = attr, IsStorage = false, Name = entry.Name, LastWriteTime = entry.LastWriteTime.DateTime, Size = entry.Length }; return(ret); }