/// <summary>复制DirEntry专属的字段</summary> /// <param name="entry"></param> internal void CopyFromDirEntry(ZipEntry entry) { Type type = this.GetType(); foreach (var item in dirMembers) { var fix = FieldInfoX.Create(type, item); fix.SetValue(this, fix.GetValue(entry)); } }
private static ZipEntry Create(String entryName, IDataSource datasource, Boolean? stored) { if (String.IsNullOrEmpty(entryName)) throw new ArgumentNullException("entryName"); entryName = entryName.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); var entry = new ZipEntry(); entry.FileName = entryName; entry.CompressionMethod = stored ?? IsZip(entryName) ? CompressionMethod.Stored : CompressionMethod.Deflated; entry.DataSource = datasource; return entry; }