17 using System.Collections.Generic;
30 private readonly Dictionary<string, ZipFileEntry> files;
34 #region Constructors and Destructors
44 this.files = entries.ToDictionary(x => x.FilenameInZip, x => x);
52 this.files =
new Dictionary<string, ZipFileEntry>(StringComparer.InvariantCultureIgnoreCase);
65 foreach (
string expansionFile
in zipPaths)
67 this.MergeZipFile(expansionFile);
73 #region Public Methods and Operators
83 foreach (var entry
in merge.ToDictionary(x => x.FilenameInZip, x => x))
85 if (this.files.ContainsKey(entry.Key))
87 this.files[entry.Key] = entry.Value;
91 this.files.Add(entry.Key, entry.Value);
104 return this.files.Values.ToArray();
118 return this.files.ContainsKey(path) ? this.files[path] : null;
129 foreach (var entry
in merge.files)
131 if (this.files.ContainsKey(entry.Key))
133 this.files[entry.Key] = entry.Value;
137 this.files.Add(entry.Key, entry.Value);
151 using (var zip =
new ZipFile(path))
153 merge = zip.GetAllEntries();
156 this.AddZipFileEntries(merge);
Represents an entry in Zip file directory
ZipFileEntry GetEntry(string path)
The get entry.
Unique class for compression/decompression file. Represents a Zip file.
void MergeZipFile(ExpansionZipFile merge)
Add all the entries from an existing ExpansionZipFile
ExpansionZipFile()
Initializes a new instance of the ExpansionZipFile class.
void AddZipFileEntries(IEnumerable< ZipFileEntry > merge)
Add all the entries from an existing ExpansionZipFile
void MergeZipFile(string path)
Add all the entries from a zip file on the system.
ZipFileEntry[] GetAllEntries()
The get all entries.
Compression
Compression method enumeration
ExpansionZipFile(IEnumerable< ZipFileEntry > entries)
Initializes a new instance of the ExpansionZipFile class.
ExpansionZipFile(IEnumerable< string > zipPaths)
Initializes a new instance of the ExpansionZipFile class. class from a collection of zip file paths...