Sets known metadata properties satisfying the specified predicate. The operation is recursive so it affects all nested packages as well. This method is a combination of AddProperties and UpdateProperties. If an existing property satisfies the predicate its value is updated. If there is a known property missing in the package that satisfies the predicate it is added to the package.
The following code snippet shows how to get metadata from a ZIP archive.
Encodingencoding=Encoding.GetEncoding(866);using(Metadatametadata=newMetadata(Constants.InputZip)){varroot=metadata.GetRootPackage<ZipRootPackage>();Console.WriteLine(root.ZipPackage.Comment);Console.WriteLine(root.ZipPackage.TotalEntries);foreach(varfileinroot.ZipPackage.Files){Console.WriteLine(file.Name);Console.WriteLine(file.CompressedSize);Console.WriteLine(file.CompressionMethod);Console.WriteLine(file.Flags);Console.WriteLine(file.ModificationDateTime);Console.WriteLine(file.UncompressedSize);// Use a specific encoding for the file namesConsole.WriteLine(encoding.GetString(file.RawName));}}