ZipPackage Class
Implements a derived subclass of the abstract Package base class—the ZipPackage class uses a ZIP archive as the container store. This class cannot be inherited.
Assembly: WindowsBase (in WindowsBase.dll)
The ZipPackage type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | FileOpenAccess | Gets the file access setting for the package. (Inherited from Package.) |
![]() | PackageProperties | Gets the core properties of the package. (Inherited from Package.) |
| Name | Description | |
|---|---|---|
![]() | Close | Saves and closes the package plus all underlying part streams. (Inherited from Package.) |
![]() | CreatePart(Uri, String) | Creates a new uncompressed part with a given URI and content type. (Inherited from Package.) |
![]() | CreatePart(Uri, String, CompressionOption) | Creates a new part with a given URI, content type, and compression option. (Inherited from Package.) |
![]() | CreatePartCore | When overridden in a derived class, creates a new part in the package. (Inherited from Package.) |
![]() | CreateRelationship(Uri, TargetMode, String) | Creates a package-level relationship to a part with a given URI, target mode, and relationship type. (Inherited from Package.) |
![]() | CreateRelationship(Uri, TargetMode, String, String) | Creates a package-level relationship to a part with a given URI, target mode, relationship type, and identifier (ID). (Inherited from Package.) |
![]() | DeletePart | Deletes a part with a given URI from the package. (Inherited from Package.) |
![]() | DeletePartCore | When overridden in a derived class, deletes a part with a given URI. (Inherited from Package.) |
![]() | DeleteRelationship | Deletes a package-level relationship. (Inherited from Package.) |
![]() | Dispose | Flushes and saves the content of all parts and relationships, closes the package, and releases all resources. (Inherited from Package.) |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | Flush | Saves the contents of all parts and relationships that are contained in the package. (Inherited from Package.) |
![]() | FlushCore | When overridden in a derived class, saves the content of all parts and relationships to the derived class store. (Inherited from Package.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetPart | Returns the part with a given URI. (Inherited from Package.) |
![]() | GetPartCore | When overridden in a derived class, returns the part addressed by a given URI. (Inherited from Package.) |
![]() | GetParts | Returns a collection of all the parts in the package. (Inherited from Package.) |
![]() | GetPartsCore | When overridden in a derived class, returns an array of all the parts in the package. (Inherited from Package.) |
![]() | GetRelationship | Returns the package-level relationship with a given identifier. (Inherited from Package.) |
![]() | GetRelationships | Returns a collection of all the package-level relationships. (Inherited from Package.) |
![]() | GetRelationshipsByType | Returns a collection of all the package-level relationships that match a given RelationshipType. (Inherited from Package.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | PartExists | Indicates whether a part with a given URI is in the package. (Inherited from Package.) |
![]() | RelationshipExists | Indicates whether a package-level relationship with a given ID is contained in the package. (Inherited from Package.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IDisposable::Dispose | This member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended for application use. Use the type-safe Dispose method instead. (Inherited from Package.) |
This example shows how to create a basic ZipPackage.
The example creates a package that contains a single document part which is defined as the package's root element by a package-level PackageRelationship.
The package also contains an image part and a second PackageRelationship which defines an association between the source document part and the target image part. (The image is a resource that is used with the document).
For the complete sample, see Writing a Package Sample.
Windows 7, Windows Vista SP1 or later, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
