Export (0) Print
Expand All

PackagePart Class

Provides a base class for parts stored in a Package. This class is abstract.

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

public abstract class PackagePart

The PackagePart type exposes the following members.

  NameDescription
Protected methodPackagePart(Package, Uri)Initializes a new instance of the PackagePart class with a specified parent Package and part URI.
Protected methodPackagePart(Package, Uri, String)Initializes a new instance of the PackagePart class with a specified parent Package, part URI, and MIME content type.
Protected methodPackagePart(Package, Uri, String, CompressionOption)Initializes a new instance of the PackagePart class with a specified parent Package, part URI, MIME content type, and CompressionOption.
Top

  NameDescription
Public propertyCompressionOptionGets the compression option of the part content stream.
Public propertyContentTypeGets the MIME type of the content stream.
Public propertyPackageGets the parent Package of the part.
Public propertyUriGets the URI of the part.
Top

  NameDescription
Public methodCreateRelationship(Uri, TargetMode, String)Creates a part-level relationship between this PackagePart to a specified target PackagePart or external resource.
Public methodCreateRelationship(Uri, TargetMode, String, String)Creates a part-level relationship between this PackagePart to a specified target PackagePart or external resource.
Public methodDeleteRelationshipDeletes a specified part-level PackageRelationship.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Protected methodGetContentTypeCoreWhen overridden in a derived class, returns the MIME type of the part content.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetRelationshipReturns the relationship that has a specified Id.
Public methodGetRelationshipsReturns a collection of all the relationships that are owned by this part.
Public methodGetRelationshipsByTypeReturns a collection of the relationships that match a specified RelationshipType.
Public methodGetStream()Returns the part content data stream.
Public methodGetStream(FileMode)Returns the content stream opened in a specified I/O FileMode.
Public methodGetStream(FileMode, FileAccess)Returns the part content stream opened with a specified FileMode and FileAccess.
Protected methodGetStreamCoreWhen overridden in a derived class, returns the part content stream opened with a specified FileMode and FileAccess.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRelationshipExistsReturns a value that indicates whether this part owns a relationship with a specified Id.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

A PackagePart consists of three basic elements:

Access

Description

Uri

The URI of the part.

ContentType

The MIME type of the content stream.

GetStream

The content data stream of the part.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.

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

Community Additions

ADD
Show:
© 2014 Microsoft