PackagePart.GetRelationshipsByType(String) 方法

定義

傳回符合指定之 RelationshipType 的關聯性集合。

public:
 System::IO::Packaging::PackageRelationshipCollection ^ GetRelationshipsByType(System::String ^ relationshipType);
public System.IO.Packaging.PackageRelationshipCollection GetRelationshipsByType (string relationshipType);
member this.GetRelationshipsByType : string -> System.IO.Packaging.PackageRelationshipCollection
Public Function GetRelationshipsByType (relationshipType As String) As PackageRelationshipCollection

參數

relationshipType
String

關聯性的 RelationshipType,可在集合中找到並傳回。

傳回

符合指定之 relationshipType 的關聯性集合。

例外狀況

relationshipTypenull

relationshipType 為空字串。

組件已經刪除。

-或-

Package 沒有開啟 (已經呼叫 Dispose(Boolean)Close())。

封裝是唯寫的 (無法讀取關聯性資訊)。

備註

傳回的集合永遠不會 null傳回;不過,如果沒有關聯性符合為元件定義的指定 relationshipType ,集合可能會包含零個專案。

字串中的任何 relationshipType 前置或尾端空格都會自動修剪。

適用於

另請參閱