PackageRelationship.TargetMode 属性

定义

获取一个值,该值指示关系的目标是 InternalExternal 指向 PackageGets a value that indicates whether the target of the relationship is Internal or External to the Package.

public:
 property System::IO::Packaging::TargetMode TargetMode { System::IO::Packaging::TargetMode get(); };
public System.IO.Packaging.TargetMode TargetMode { get; }
member this.TargetMode : System.IO.Packaging.TargetMode
Public ReadOnly Property TargetMode As TargetMode

属性值

一个枚举值,它指示 TargetUri 是否引用指向 InternalExternalPackageAn enumeration value that indicates whether TargetUri references a resource Internal or External to the Package.

注解

TargetMode 在对的调用中指定。CreateRelationshipThe TargetMode is specified in the call to the Package.CreateRelationship PackagePartCreateRelationshipor PackagePart.CreateRelationship 创建关系的方法。method that created the relationship. 创建关系后,不能更改 TargetModeAfter the relationship is created the TargetMode cannot be changed.

InternalTargetMode 时,TargetUri 必须是相对引用。When TargetMode is Internal, the TargetUri MUST be a relative reference. 对于包级别关系,将解析 TargetUri 相对于拥有和包含关系的源包的 pack URI 的相对引用。For a package-level relationship, the relative reference of the TargetUri is resolved relative to the pack URI of the source package that owns and contains the relationship. (示例源包包 URI: "pack://http:,,,datapak,files,/"。) 对于部分级别关系,将相对于拥有关系的源部分解析 TargetUriTargetUri 相对于 SourceUri进行解释)。(Example source package pack URI: "pack://http:,,www.adatum.com,files,datapak.package/".) For a part-level relationship, the TargetUri is resolved relative to the source part that owns the relationship (TargetUri is interpreted relative to SourceUri).

ExternalTargetMode 时,TargetUri 可以是相对引用或完全限定 URI。When TargetMode is External, the TargetUri can be either a relative reference or a fully qualified URI. 如果 TargetUri 是相对引用,则引用将被解释为相对于包含此关系的 Package 的位置。If the TargetUri is a relative reference, the reference is interpreted as relative to the location of the Package that contains this relationship.

有关 TargetMode 详细信息,请参阅 https://go.microsoft.com/fwlink/?LinkID=71255的可供下载的开放打包约定规范的 "关系标记" 部分1.3.3。For more information about TargetMode see Section 1.3.3 "Relationship Markup" of the Open Packaging Conventions specification available for download at https://go.microsoft.com/fwlink/?LinkID=71255.

适用于

另请参阅