Create Method

PackUriHelper.Create Method

 

Creates a new pack URI.

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

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticCreate(Uri)

Creates a new pack URI that points to a package.

System_CAPS_pubmethodSystem_CAPS_staticCreate(Uri, Uri)

Creates a pack URI given a Package URI and the URI of a part in the package.

System_CAPS_pubmethodSystem_CAPS_staticCreate(Uri, Uri, String)

Creates a pack URI given a Package URI, the URI of a part in the package, and a "#" fragment to append.

The following table illustrates sample cases for the Create method.

 packageUri

 partUri

 fragment

 Returned pack URI

 http://www.proseware.com/mypackage.pkg 

 /page1.xaml 

 #intro 

 pack://http:,,www.proseware.com,mypackage.pkg/page1.xaml#intro 

 http://www.proseware.com/mypackage.pkg 

 /page2.xaml 

 null 

 pack://http:,,www.proseware.com,mypackage.pkg/page2.xaml 

 http://www.proseware.com/mypackage.pkg 

 /a/page4.xaml 

 null 

 pack://http:,,www.proseware.com,mypackage.pkg/a/page4.xaml 

 http://www.proseware.com/mypackage.pkg 

 /%41/%61.xml 

 null 

 pack://http:,,www.proseware.com,mypackage.pkg/A/a.xml 

 http://www.proseware.com/mypackage.pkg 

 /%25XY.xml 

 null 

 pack://http:,,www.proseware.com,mypackage.pkg/%25XY.xml 

 http://www.proseware.com/mypackage.pkg 

 /a/page5.xaml 

 #summary

 pack://http:,,www.proseware.com,mypackage.pkg/a/page5.xaml#summary 

 http://www.proseware.com/packages.aspx?pkg04 

 /page1.xaml 

 #intro 

 pack://http:,,www.proseware.com,packages.aspx%3fpkg04/page1.xaml#intro 

 http://www.proseware.com/mypackage.pkg 

 null 

 null 

 pack://http:,,www.proseware.com,mypackage.pkg 

 ftp://ftp.proseware.com/packages/mypackage1.abc 

 /a/mydoc.xaml 

 null 

 pack://ftp:,,ftp.proseware.com,packages,mypackage1.abc/a/mydoc.xaml 

 file:///d:/packages/mypackage2.pkg 

 /a/bar.xaml 

 #xref 

 pack://file:,,,d:,packages,mypackage2.pkg/a/bar.xaml#xref 

Composing a pack URI is a multi-step process. For example, one step in forming a pack URI is to replace the forward slash (/) characters of the packageUri with commas (,).

For more information on string conversion and how pack URIs are formed, see Appendix A.4 "String Conversion Examples" and Appendix B.3 "Composing a Pack URI" in the Open Packaging Conventions specification available for download at Specifications and License Downloads.

Return to top
Show:
© 2016 Microsoft