本文整理汇总了VB.NET中System.IO.Packaging.PackUriHelper.Create方法的典型用法代码示例。如果您正苦于以下问题:VB.NET PackUriHelper.Create方法的具体用法?VB.NET PackUriHelper.Create怎么用?VB.NET PackUriHelper.Create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了PackUriHelper.Create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: GetFixedDocument
' ------------------------ GetFixedDocument --------------------------
''' <summary>
''' Returns the fixed document at a given URI within
''' the currently open XPS package.</summary>
''' <param name="fixedDocUri">
''' The URI of the fixed document to return.</param>
''' <returns>
''' The fixed document at a given URI
''' within the current XPS package.</returns>
Private Function GetFixedDocument(ByVal fixedDocUri As Uri) As FixedDocument
Dim fixedDocument As FixedDocument = Nothing
' Create the URI for the fixed document within the package. The URI
' is used to set the Parser context so fonts & other items can load.
Dim tempUri As New Uri(_xpsDocumentPath, UriKind.RelativeOrAbsolute)
Dim parserContext As New ParserContext()
parserContext.BaseUri = PackUriHelper.Create(tempUri)
' Retrieve the fixed document.
Dim fixedDocPart As PackagePart = _xpsPackage.GetPart(fixedDocUri)
If fixedDocPart IsNot Nothing Then
Dim fixedObject As Object = XamlReader.Load(fixedDocPart.GetStream(), parserContext)
If fixedObject IsNot Nothing Then
fixedDocument = TryCast(fixedObject, FixedDocument)
End If
End If
Return fixedDocument
End Function ' end:GetFixedDocument()