PackUriHelper.GetPartUri(Uri) Método
Definição
Retorna o URI de um PackagePart dentro de um URI de pacote especificado.Returns the URI of a PackagePart within a specified pack URI.
public:
static Uri ^ GetPartUri(Uri ^ packUri);
public static Uri GetPartUri (Uri packUri);
public static Uri? GetPartUri (Uri packUri);
static member GetPartUri : Uri -> Uri
Public Shared Function GetPartUri (packUri As Uri) As Uri
Parâmetros
- packUri
- Uri
O URI de pacote do qual retornar o PackagePart URI.The pack URI from which to return the PackagePart URI.
Retornos
O URI do PackagePart no packUri determinado ou null se packUri apontar para um pacote, em vez de um PackagePart.The URI of the PackagePart in the given packUri, or null if packUri points to a package instead of a PackagePart.
Exceções
Se o packUri for null.If the packUri is null.
Se packUri não for um Uri absoluto.If the packUri is not an absolute Uri.
- ou --or-
packUri não tem o esquema "pack://".packUri does not have the "pack://" scheme.
- ou --or-
O partUri extraído de packUri não está em conformidade com a sintaxe partUri válida.The partUri extracted from packUri does not conform to the valid partUri syntax.
Comentários
O PackagePart URI retornado é relativo à raiz do pacote e é um caminho absoluto que sempre começa com "/" e está em conformidade com a sintaxe definida na especificação Open Packaging Conventions.The returned PackagePart URI is relative to the package root and is an absolute path that always starts with "/" and conforms to the syntax defined in the Open Packaging Conventions Specification.
A tabela a seguir ilustra exemplos de casos para o GetPartUri .The following table illustrates sample cases for GetPartUri.
packUri |
URI da parte retornadaReturned Part URI |
|---|---|
| Pack://http:,, www. proseware. com, myPackage. xyz/a/MyDoc. XAMLpack://http:,,www.proseware.com,mypackage.xyz/a/mydoc.xaml | /a/mydoc.xaml/a/mydoc.xaml |
| Pack://http:,, www. proseware. com, packages. aspx %3 f MyPackage/a/bar. XAMLpack://http:,,www.proseware.com,packages.aspx%3fmypackage/a/bar.xaml | /a/bar.xaml/a/bar.xaml |
| Pack://http:,, www. proseware. com, myPackage. pkgpack://http:,,www.proseware.com,mypackage.pkg | nullnull |
| Pack://ftp:,, FTP. proseware. com, Packages, mypackage1. ABC/a/picture.jpgpack://ftp:,,ftp.proseware.com,packages,mypackage1.abc/a/picture.jpg | picture.jpg/a//a/picture.jpg |
| pack://file:,,, d:, Packages, mypackage2. pkg/a/bar. XAMLpack://file:,,,d:,packages,mypackage2.pkg/a/bar.xaml | /a/bar.xaml/a/bar.xaml |