Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Xml.​Resolvers.​XmlPreloadedResolver
Assembly: System.Xml.ReaderWriter
Inheritance: object → XmlResolver → XmlPreloadedResolver
Represents a class that is used to prepopulate the cache with DTDs or XML streams.
Properties
Credentials
Sets the credentials that are used to authenticate the underlying <see cref="T:System.Net.WebRequest" /> .
public
Collections.​Generic.​IEnumerable<​Uri>
PreloadedUris
Gets a collection of preloaded URIs.
Methods
public
void
Add​(Uri uri,
byte[] value)
Adds a byte array to the <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> store and maps it to a URI. If the store already contains a mapping for the same URI, the existing mapping is overridden.
uri
The URI of the data that is being added to the <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> store.
value
A byte array with the data that corresponds to the provided URI.
public
void
Add​(Uri uri,
byte[] value,
int offset,
int count)
Adds a byte array to the <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> store and maps it to a URI. If the store already contains a mapping for the same URI, the existing mapping is overridden.
uri
The URI of the data that is being added to the <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> store.
value
A byte array with the data that corresponds to the provided URI.
offset
The offset in the provided byte array where the data starts.
count
The number of bytes to read from the byte array, starting at the provided offset.
public
void
Add​(Uri uri,
IO.​Stream value)
Adds a <see cref="T:System.IO.Stream" /> to the <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> store and maps it to a URI. If the store already contains a mapping for the same URI, the existing mapping is overridden.
uri
The URI of the data that is being added to the <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> store.
value
A <see cref="T:System.IO.Stream" /> with the data that corresponds to the provided URI.
public
void
Add​(Uri uri,
string value)
Adds a string with preloaded data to the <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> store and maps it to a URI. If the store already contains a mapping for the same URI, the existing mapping is overridden.
uri
The URI of the data that is being added to the <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> store.
value
A <see langword="String" /> with the data that corresponds to the provided URI.
public
object
GetEntity​(Uri absoluteUri,
string role,
Type ofObjectToReturn)
Maps a URI to an object that contains the actual resource.
Returns A <see cref="T:System.IO.Stream" /> or <see cref="T:System.IO.TextReader" /> object that corresponds to the actual source.
absoluteUri
The URI returned from <see cref="M:System.Xml.XmlResolver.ResolveUri(System.Uri,System.String)" /> .
role
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
The type of object to return. The <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> supports <see cref="T:System.IO.Stream" /> objects and <see cref="T:System.IO.TextReader" /> objects for URIs that were added as <see langword="String" /> . If the requested type is not supported by the resolver, an exception will be thrown. Use the <see cref="M:System.Xml.Resolvers.XmlPreloadedResolver.SupportsType(System.Uri,System.Type)" /> method to determine whether a certain <see langword="Type" /> is supported by this resolver.
public
Threading.​Tasks.​Task<​object>
GetEntityAsync​(Uri absoluteUri,
string role,
Type? ofObjectToReturn)
Asynchronously maps a URI to an object that contains the actual resource.
Returns A <see cref="T:System.IO.Stream" /> or <see cref="T:System.IO.TextReader" /> object that corresponds to the actual source.
absoluteUri
The URI returned from <see cref="M:System.Xml.XmlResolver.ResolveUri(System.Uri,System.String)" /> .
role
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
The type of object to return. The <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> supports <see cref="T:System.IO.Stream" /> objects and <see cref="T:System.IO.TextReader" /> objects for URIs that were added as <see langword="String" /> . If the requested type is not supported by the resolver, an exception will be thrown. Use the <see cref="M:System.Xml.Resolvers.XmlPreloadedResolver.SupportsType(System.Uri,System.Type)" /> method to determine whether a certain <see langword="Type" /> is supported by this resolver.
public
void
Remove​(Uri uri)
Removes the data that corresponds to the URI from the <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> .
uri
The URI of the data that should be removed from the <see cref="T:System.Xml.Resolvers.XmlPreloadedResolver" /> store.
public
Uri
ResolveUri​(Uri baseUri,
string relativeUri)
Resolves the absolute URI from the base and relative URIs.
Returns The <see cref="T:System.Uri" /> representing the absolute URI or <see langword="null" /> if the relative URI cannot be resolved.
baseUri
The base URI used to resolve the relative URI.
relativeUri
The URI to resolve. The URI can be absolute or relative. If absolute, this value effectively replaces the <paramref name="baseUri" /> value. If relative, it combines with the <paramref name="baseUri" /> to make an absolute URI.
public
bool
SupportsType​(Uri absoluteUri,
Type? type)
Determines whether the resolver supports other <see cref="T:System.Type" /> s than just <see cref="T:System.IO.Stream" /> .
Returns <see langword="true" /> if the <see cref="T:System.Type" /> is supported; otherwise, <see langword="false" /> .
absoluteUri
The absolute URI to check.
type
The <see cref="T:System.Type" /> to return.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object