PackagePart.GetRelationships 方法

定義

傳回這個組件所擁有之全部關聯性的集合。Returns a collection of all the relationships that are owned by this part.

public:
 System::IO::Packaging::PackageRelationshipCollection ^ GetRelationships();
public System.IO.Packaging.PackageRelationshipCollection GetRelationships ();
member this.GetRelationships : unit -> System.IO.Packaging.PackageRelationshipCollection
Public Function GetRelationships () As PackageRelationshipCollection

傳回

PackageRelationshipCollection

這個組件所擁有之全部關聯性的集合。A collection of all the relationships that are owned by the part.

例外狀況

組件已經刪除。The part has been deleted.

-或--or- Package 沒有開啟 (已經呼叫 Dispose(Boolean)Close())。The Package is not open (Dispose(Boolean) or Close() has been called).

封裝是唯寫的 (無法讀取關聯性資訊)。The package is write-only (relationship information cannot be read).

備註

傳回的集合永遠不會 null ; 不過,如果元件沒有定義任何關聯性,則集合可能包含零個元素。The returned collection is never null; however, the collection might contain zero elements if the part does not define any relationships.

適用於

另請參閱