PackagePart.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 the relationships that match a specified RelationshipType.

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

public PackageRelationshipCollection GetRelationshipsByType(
	string relationshipType
)

Parameters

relationshipType
Type: System.String

The RelationshipType of the relationships to locate and return in the collection.

Return Value

Type: System.IO.Packaging.PackageRelationshipCollection

A collection of the relationships that match the specified relationshipType.

Exception Condition
ArgumentNullException

relationshipType is null.

ArgumentException

relationshipType is an empty string.

InvalidOperationException

The part has been deleted.

-or-

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

IOException

The package is write-only (relationship information cannot be read).

The returned collection is never null; however, the collection might contain zero elements if no relationships match the specified relationshipType that is defined for the part.

Any leading or trailing spaces in the relationshipType string are automatically trimmed.

.NET Framework
Available since 3.0
Return to top
Show: