GetRelationshipsByType Method

PackagePart.GetRelationshipsByType Method

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
)
public PackageRelationshipCollection GetRelationshipsByType (
	String relationshipType
)
public function GetRelationshipsByType (
	relationshipType : String
) : PackageRelationshipCollection
You cannot use methods in XAML.

Parameters

relationshipType

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

Return Value

A collection of the relationships that match the specified relationshipType.

Exception typeCondition

ArgumentNullException

relationshipType is a null reference (Nothing in Visual Basic).

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2016 Microsoft