XmlPreloadedResolver::GetEntity Method (Uri^, String^, Type^)
Maps a URI to an object that contains the actual resource.
Assembly: System.Xml (in System.Xml.dll)
public: virtual Object^ GetEntity( Uri^ absoluteUri, String^ role, Type^ ofObjectToReturn ) override
Parameters
- absoluteUri
-
Type:
System::Uri^
The URI returned from ResolveUri.
- role
-
Type:
System::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:
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 whether a certain Type is supported by this resolver.
Return Value
Type: System::Object^A Stream or TextReader object that corresponds to the actual source.
| Exception | Condition |
|---|---|
| ArgumentNullException | absoluteUri is null. |
| XmlException | Cannot resolve URI passed in absoluteUri. -or- ofObjectToReturn is not of a supported type. |
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.
Available since 4.0
Silverlight
Available since 2.0