PackagePart.GetRelationship(String) 메서드

정의

지정된 Id의 관계를 반환합니다.

public:
 System::IO::Packaging::PackageRelationship ^ GetRelationship(System::String ^ id);
public System.IO.Packaging.PackageRelationship GetRelationship (string id);
member this.GetRelationship : string -> System.IO.Packaging.PackageRelationship
Public Function GetRelationship (id As String) As PackageRelationship

매개 변수

id
String

반환할 관계의 Id입니다.

반환

PackageRelationship

지정된 id와 일치하는 관계입니다.

예외

id이(가) null인 경우

id가 올바른 XML 식별자가 아닌 경우

relationshipType이 빈 문자열인 경우

파트가 삭제된 경우

또는 Package가 열려 있지 않은 경우(Dispose(Boolean) 또는 Close()가 호출된 경우)

또는 지정된 id의 관계가 패키지에 없는 경우

패키지가 쓰기 전용인 경우. 이 경우 관계 정보를 읽을 수 없습니다.

설명

id 는 유효한 XML 식별자여야 합니다. 형식은 id xsd:ID이며 XML 스키마 2부: 데이터 형식 사양에 규정된 명명 규칙을 따라야 합니다(참조 https://www.w3.org/TR/xmlschema-2/#ID).

이 메서드를 RelationshipExists 사용하여 지정된 Id 관계와의 관계가 이 파트에서 소유하는지 확인할 수 있습니다.

적용 대상

추가 정보