.NET Framework Class Library
PackUriHelper..::.GetSourcePartUriFromRelationshipPartUri Method

Returns the SourceUri from the PackageRelationship with a specified URI.

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

Visual Basic (Declaration)
Public Shared Function GetSourcePartUriFromRelationshipPartUri ( _
    relationshipPartUri As Uri _
) As Uri
Visual Basic (Usage)
Dim relationshipPartUri As Uri
Dim returnValue As Uri

returnValue = PackUriHelper.GetSourcePartUriFromRelationshipPartUri(relationshipPartUri)
C#
public static Uri GetSourcePartUriFromRelationshipPartUri(
    Uri relationshipPartUri
)
Visual C++
public:
static Uri^ GetSourcePartUriFromRelationshipPartUri(
    Uri^ relationshipPartUri
)
JScript
public static function GetSourcePartUriFromRelationshipPartUri(
    relationshipPartUri : Uri
) : Uri
XAML
You cannot use methods in XAML.

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.
Exceptions

ExceptionCondition
ArgumentNullException

relationshipPartUri is nullNothingnullptra null reference (Nothing in Visual Basic).

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).

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".

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0
See Also

Reference

Other Resources

Tags :


Page view tracker