PackUriHelper.GetSourcePartUriFromRelationshipPartUri Method

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.

ExceptionCondition
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

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft