PackagePart.RelationshipExists(String) 方法

定義

傳回值,表示這個組件是否擁有包含指定之 Id 的關聯性。

public:
 bool RelationshipExists(System::String ^ id);
public bool RelationshipExists (string id);
member this.RelationshipExists : string -> bool
Public Function RelationshipExists (id As String) As Boolean

參數

id
String

要檢查之關聯性的 Id

傳回

如果這個組件擁有包含指定之 id 的關聯性,則為 true,否則為 false

例外狀況

idnull

id 不是有效的 XML 識別項。

組件已經刪除。

-或-

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

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

備註

id 必須是有效的 XML 識別碼。 此 id 類型為 xsd:ID,且必須遵循 XML 架構第 2 部分:資料類型 規格中指定的命名慣例, (請參閱 https://www.w3.org/TR/xmlschema-2/#ID) 。

適用於

另請參閱