GetSourcePartUriFromRelationshipPartUri Method

PackUriHelper.GetSourcePartUriFromRelationshipPartUri Method (Uri)

 

Returns the SourceUri from the PackageRelationship with a specified URI.

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

public static Uri GetSourcePartUriFromRelationshipPartUri(
	Uri relationshipPartUri
)

Parameters

relationshipPartUri
Type: System.Uri

The URI of the relationship part to return the SourceUri from.

Return Value

Type: System.Uri

The SourceUri of the PackagePart from the relationship with the specified relationshipPartUri.

Exception Condition
ArgumentNullException

relationshipPartUri is null.

ArgumentException

relationshipPartUri is an absolute URI.

-or-

relationshipPartUri syntax is not valid for a PackagePart.

-or-

relationshipPartUri does not reference a relationship part.

-or-

The SourceUri of the relationship part references another relationship part (not valid, see Remarks).

The SourceUri property of a relationship part must identify either the Package ("/") or a PackagePart that is not a PackageRelationship.

For example, if the package part "/files/document.xaml" is the source owner of the relationship part "/files/_rels/document.xaml.rels", calling GetSourcePartUriFromRelationshipPartUri with the relationshipPartUri parameter of "/files/_rels/document.xaml.rels" returns the SourceUri of "/files/document.xaml".

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft