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.​XmlSecureResolver
Assembly: System.Xml.ReaderWriter
Inheritance: object → XmlResolver → XmlSecureResolver
Helps to secure another implementation of <see cref="T:System.Xml.XmlResolver" /> by wrapping the <see cref="T:System.Xml.XmlResolver" /> object and restricting the resources that the underlying <see cref="T:System.Xml.XmlResolver" /> has access to.
Properties
Credentials
Sets credentials used to authenticate web requests.
Methods
public
object
GetEntity​(Uri absoluteUri,
string role,
Type ofObjectToReturn)
Maps a URI to an object that contains the actual resource. This method temporarily sets the <see cref="T:System.Security.PermissionSet" /> created in the constructor by calling <see cref="M:System.Security.PermissionSet.PermitOnly" /> before calling <see langword="GetEntity" /> on the underlying <see cref="T:System.Xml.XmlResolver" /> to open the resource.
Returns The stream returned by calling <see langword="GetEntity" /> on the underlying <see cref="T:System.Xml.XmlResolver" /> . If a type other than <see cref="T:System.IO.Stream" /> is specified, the method returns <see langword="null" /> .
absoluteUri
The URI that is returned from <see cref="M:System.Xml.XmlSecureResolver.ResolveUri(System.Uri,System.String)" /> .
role
Currently not used.
ofObjectToReturn
The type of object to return. The current version only returns <see cref="T:System.IO.Stream" /> objects.
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 The stream returned by calling <see langword="GetEntity" /> on the underlying <see cref="T:System.Xml.XmlResolver" /> . If a type other than <see cref="T:System.IO.Stream" /> is specified, the method returns <see langword="null" /> .
absoluteUri
The URI returned from <see cref="M:System.Xml.XmlSecureResolver.ResolveUri(System.Uri,System.String)" /> .
role
Currently not used.
ofObjectToReturn
The type of object to return. The current version only returns <see cref="T:System.IO.Stream" /> objects.
public
Uri
ResolveUri​(Uri baseUri,
string relativeUri)
Resolves the absolute URI from the base and relative URIs by calling <see langword="ResolveUri" /> on the underlying <see cref="T:System.Xml.XmlResolver" /> .
Returns The absolute URI or <see langword="null" /> if the relative URI cannot be resolved (returned by calling <see langword="ResolveUri" /> on the underlying <see cref="T:System.Xml.XmlResolver" /> ).
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)
Inherited from XmlResolver
Enables the resolver to return types other than <see cref="T:System.IO.Stream" /> .
Returns <see langword="true" /> if the <paramref name="type" /> is supported; otherwise, <see langword="false" /> .
absoluteUri
The URI.
type
The 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