PackagePart 类

定义

为存储在 Package 中的部分提供基类。Provides a base class for parts stored in a Package. 此类是抽象类。This class is abstract.

public ref class PackagePart abstract
public abstract class PackagePart
type PackagePart = class
Public MustInherit Class PackagePart
继承
PackagePart
派生

注解

PackagePart 包含三个基本元素:A PackagePart consists of three basic elements:

访问Access 说明Description
Uri 部件的 URI。The URI of the part.
ContentType 内容流的 MIMEMIME 类型。The MIMEMIME type of the content stream.
GetStream 此部分的内容数据流。The content data stream of the part.

构造函数

PackagePart(Package, Uri)

使用指定的父 PackagePart 和部件 URI 初始化 Package 类的新实例。Initializes a new instance of the PackagePart class with a specified parent Package and part URI.

PackagePart(Package, Uri, String)

使用指定的父 PackagePart、部件 URI 和 Package 内容类型初始化 MIMEMIME 类的新实例。Initializes a new instance of the PackagePart class with a specified parent Package, part URI, and MIMEMIME content type.

PackagePart(Package, Uri, String, CompressionOption)

使用指定的父 PackagePart、部件 URI、Package 内容类型和 MIMEMIME 初始化 CompressionOption 类的新实例。Initializes a new instance of the PackagePart class with a specified parent Package, part URI, MIMEMIME content type, and CompressionOption.

属性

CompressionOption

获取部分内容流的压缩选项。Gets the compression option of the part content stream.

ContentType

获取内容流的 MIMEMIME 类型。Gets the MIMEMIME type of the content stream.

Package

获取此部分的父 PackageGets the parent Package of the part.

Uri

获取部件的 URI。Gets the URI of the part.

方法

CreateRelationship(Uri, TargetMode, String)

创建此 PackagePart 与指定目标 PackagePart 或外部资源之间的部分级关系。Creates a part-level relationship between this PackagePart to a specified target PackagePart or external resource.

CreateRelationship(Uri, TargetMode, String, String)

创建此 PackagePart 与指定目标 PackagePart 或外部资源之间的部分级关系。Creates a part-level relationship between this PackagePart to a specified target PackagePart or external resource.

DeleteRelationship(String)

删除指定的部分级 PackageRelationshipDeletes a specified part-level PackageRelationship.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetContentTypeCore()

当在派生类中重写时,返回部分内容的 MIMEMIME 类型。When overridden in a derived class, returns the MIMEMIME type of the part content.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetRelationship(String)

返回具有指定 Id 的关系。Returns the relationship that has a specified Id.

GetRelationships()

返回此部分拥有的所有关系的集合。Returns a collection of all the relationships that are owned by this part.

GetRelationshipsByType(String)

返回与指定 RelationshipType 相匹配的关系的集合。Returns a collection of the relationships that match a specified RelationshipType.

GetStream()

返回部分内容数据流。Returns the part content data stream.

GetStream(FileMode)

返回在指定 I/O FileMode 中打开的内容流。Returns the content stream opened in a specified I/O FileMode.

GetStream(FileMode, FileAccess)

返回使用指定 FileModeFileAccess 打开的部分内容流。Returns the part content stream opened with a specified FileMode and FileAccess.

GetStreamCore(FileMode, FileAccess)

当在派生类中重写时,返回使用指定的 FileModeFileAccess 打开的部分内容流。When overridden in a derived class, returns the part content stream opened with a specified FileMode and FileAccess.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
RelationshipExists(String)

返回一个值,指示此部分是否拥有具有指定 Id 的关系。Returns a value that indicates whether this part owns a relationship with a specified Id.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅