XmlPreloadedResolver.GetEntity Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Maps a URI to an object that contains the actual resource.

Namespace:  System.Xml.Resolvers
Assembly:  System.Xml.Utils (in System.Xml.Utils.dll)

Syntax

'Declaration
Public Overrides Function GetEntity ( _
    absoluteUri As Uri, _
    role As String, _
    ofObjectToReturn As Type _
) As Object
public override Object GetEntity(
    Uri absoluteUri,
    string role,
    Type ofObjectToReturn
)

Parameters

  • role
    Type: System.String
    The current version of the .NET Framework for Silverlight does not use this parameter when resolving URIs. This is provided for future extensibility purposes. For example, this can be mapped to the xlink:role and used as an implementation specific argument in other scenarios.
  • ofObjectToReturn
    Type: System.Type
    The type of object to return. The XmlPreloadedResolver supports Stream objects and TextReader objects for URIs that were added as String. If the requested type is not supported by the resolver, an exception will be thrown. Use the SupportsType method to determine if a certain Type is supported by this resolver.

Return Value

Type: System.Object
A Stream or TextReader object.

Exceptions

Exception Condition
ArgumentNullException

absoluteUri is nulla null reference (Nothing in Visual Basic).

XmlException

Cannot resolve URI passed in absoluteUri.

-or-

ofObjectToReturn is not of a supported type.

Remarks

The XmlPreloadedResolver will first try to lookup the resource in its store of preloaded data. If it cannot find it, it will call the fallback resolver's GetEntity method. If no fallback resolver was provided in the XmlPreloadedResolver constructor, an exception is thrown.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.