Package::GetRelationshipsByType Method (String^)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns a collection of all the package-level relationships that match a given RelationshipType.

Namespace:   System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)

public:
PackageRelationshipCollection^ GetRelationshipsByType(
	String^ relationshipType
)

Parameters

relationshipType
Type: System::String^

The RelationshipType to match and return in the collection.

Return Value

Type: System.IO.Packaging::PackageRelationshipCollection^

A collection of package-level relationships that match the specified relationshipType.

Exception Condition
ArgumentNullException

relationshipType is null.

ArgumentException

relationshipType is an empty string.

ObjectDisposedException

The package is not open (Dispose or Close has been called).

IOException

The package is write-only.

GetRelationships will never return null; however the returned collection may contain zero elements if there are no package-level relationships that match the specified relationshipType.

The following table shows the package-level relationshipType URIs defined by the Open Packaging Conventions (OPC) specification.

Package-level Relationship

Relationship Type URI

Core Properties

http://schemas.openxmlformats.org/package/2006/relationships/meta data/core-properties

Digital Signature

http://schemas.openxmlformats.org/package/2006/relationships/digit al-signature/signature

Digital Signature Certificate

http://schemas.openxmlformats.org/package/2006/relationships/digit al-signature/certificate

Digital Signature Origin

http://schemas.openxmlformats.org/package/2006/relationships/digit al-signature/origin

Thumbnail

http://schemas.openxmlformats.org/package/2006/relationships/meta data/thumbnail

For additional information, see the Open Packaging Conventions (OPC) specification available for download at http://go.microsoft.com/fwlink/?LinkID=71255.

The following example shows how to retrieve the relationships that have been defined for the package. For the complete sample, see Reading a Package Sample.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: