ZipPackage Class

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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.

Namespace:   System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)

System.Object
  System.IO.Packaging.Package
    System.IO.Packaging.ZipPackage

[<Sealed>]
type ZipPackage = 
    class
        inherit Package
    end

NameDescription
System_CAPS_pubpropertyFileOpenAccess

Gets the file access setting for the package.(Inherited from Package.)

System_CAPS_pubpropertyPackageProperties

Gets the core properties of the package.(Inherited from Package.)

NameDescription
System_CAPS_pubmethodClose()

Saves and closes the package plus all underlying part streams.(Inherited from Package.)

System_CAPS_pubmethodCreatePart(Uri, String)

Creates a new uncompressed part with a given URI and content type.(Inherited from Package.)

System_CAPS_pubmethodCreatePart(Uri, String, CompressionOption)

Creates a new part with a given URI, content type, and compression option.(Inherited from Package.)

System_CAPS_pubmethodCreateRelationship(Uri, TargetMode, String)

Creates a package-level relationship to a part with a given URI, target mode, and relationship type. (Inherited from Package.)

System_CAPS_pubmethodCreateRelationship(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.)

System_CAPS_pubmethodDeletePart(Uri)

Deletes a part with a given URI from the package.(Inherited from Package.)

System_CAPS_pubmethodDeleteRelationship(String)

Deletes a package-level relationship.(Inherited from Package.)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodFlush()

Saves the contents of all parts and relationships that are contained in the package.(Inherited from Package.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetPart(Uri)

Returns the part with a given URI.(Inherited from Package.)

System_CAPS_pubmethodGetParts()

Returns a collection of all the parts in the package.(Inherited from Package.)

System_CAPS_pubmethodGetRelationship(String)

Returns the package-level relationship with a given identifier.(Inherited from Package.)

System_CAPS_pubmethodGetRelationships()

Returns a collection of all the package-level relationships.(Inherited from Package.)

System_CAPS_pubmethodGetRelationshipsByType(String)

Returns a collection of all the package-level relationships that match a given RelationshipType. (Inherited from Package.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodPartExists(Uri)

Indicates whether a part with a given URI is in the package.(Inherited from Package.)

System_CAPS_pubmethodRelationshipExists(String)

Indicates whether a package-level relationship with a given ID is contained in the package.(Inherited from Package.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIDisposable.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.)

The Package.Open method uses ZipPackage containers by default.

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).

No code example is currently available or this language may not be supported.

For the complete sample, see Writing a Package Sample.

.NET Framework
Available since 3.0

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: