Package::GetRelationshipsByType Method
Returns a collection of all the package-level relationships that match a given RelationshipType.
Assembly: WindowsBase (in WindowsBase.dll)
Parameters
- relationshipType
- Type: System::String
The RelationshipType to match and return in the collection.
Return Value
Type: System.IO.Packaging::PackageRelationshipCollectionA collection of package-level relationships that match the specified relationshipType.
| Exception | Condition |
|---|---|
| ArgumentNullException | relationshipType is nullptr. |
| ArgumentException | relationshipType is an empty string. |
| ObjectDisposedException | |
| 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.
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.