Export (0) Print
Expand All

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)

member GetRelationshipsByType : 
        relationshipType:string -> PackageRelationshipCollection

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 a null reference (Nothing in Visual Basic).

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 a null reference (Nothing in Visual Basic); 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.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft