PackagePart Constructor (Package, Uri)

Initializes a new instance of the PackagePart class with a specified parent Package and part URI.

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

protected PackagePart(
	Package package,
	Uri partUri
)

Parameters

package
Type: System.IO.Packaging.Package

The parent Package of the part.

partUri
Type: System.Uri

The URI of the part, relative to the parent Package root.

ExceptionCondition
ArgumentNullException

package or partUri is null.

partUri must be valid PackagePart URI formed in accordance with the RFC 3986 Uniform Resource Identifier (URI) Generic Syntax specification and the Open Packaging Conventions specification.

Use this constructor when the ContentType of the part is not immediately known and will be set later when CreatePart is called.

By default, the CompressionOption property of the part is initialized to NotCompressed.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft