編輯

共用方式為


XmlPreloadedResolver.GetEntity(Uri, String, Type) Method

Definition

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

public:
 override System::Object ^ GetEntity(Uri ^ absoluteUri, System::String ^ role, Type ^ ofObjectToReturn);
public override object? GetEntity (Uri absoluteUri, string? role, Type? ofObjectToReturn);
public override object GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn);
override this.GetEntity : Uri * string * Type -> obj
Public Overrides Function GetEntity (absoluteUri As Uri, role As String, ofObjectToReturn As Type) As Object

Parameters

absoluteUri
Uri

The URI returned from ResolveUri(Uri, String).

role
String

The current version of the .NET Framework for Silverlight does not use this parameter when resolving URIs. This parameter is provided for future extensibility purposes. For example, this parameter can be mapped to the xlink:role and used as an implementation-specific argument in other scenarios.

ofObjectToReturn
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(Uri, Type) method to determine whether a certain Type is supported by this resolver.

Returns

A Stream or TextReader object that corresponds to the actual source.

Exceptions

absoluteUri is null.

Cannot resolve URI passed in absoluteUri.

-or-

ofObjectToReturn is not of a supported type.

Remarks

The XmlPreloadedResolver will first try to look up 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.

Applies to