This documentation is archived and is not being maintained.

Package::GetRelationshipsByType Method

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.

ExceptionCondition
ArgumentNullException

relationshipType is nullptr.

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 nullptr; 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

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: