Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

324 lines
18 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Type Name="XmlUrlResolver" FullName="System.Xml.XmlUrlResolver" FullNameSP="System_Xml_XmlUrlResolver" Maintainer="ecma">
<TypeSignature Language="ILASM" Value=".class public XmlUrlResolver extends System.Xml.XmlResolver" />
<TypeSignature Language="C#" Value="public class XmlUrlResolver : System.Xml.XmlResolver" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit XmlUrlResolver extends System.Xml.XmlResolver" />
<MemberOfLibrary>XML</MemberOfLibrary>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement>
<Base>
<BaseTypeName>System.Xml.XmlResolver</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>XmlUrlResolver is used to resolve external XML resources such as entities, document type definitions (DTDs) or schemas. It is also used to process include and import elements found in Extensible StyleSheet Language (XSL) style sheets or XML Schema definition language (XSD) schemas.</para>
<para>XmlUrlResolver is the default resolver for all classes in the <see cref="N:System.Xml" /> namespace. It supports the file:// and http:// protocols and requests from the <see cref="T:System.Net.WebRequest" /> class.</para>
<block subset="none" type="note">
<para>
<see cref="T:System.Xml.XmlUrlResolver" /> objects can contain sensitive information such as user credentials. You should be careful when you cache <see cref="T:System.Xml.XmlUrlResolver" /> objects and should not pass <see cref="T:System.Xml.XmlUrlResolver" /> objects to an untrusted component.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Resolves external XML resources named by a Uniform Resource Identifier (URI).</para>
</summary>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor()" />
<MemberSignature Language="C#" Value="public XmlUrlResolver ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue />
<Parameters />
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Xml.XmlUrlResolver" /> class.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="CachePolicy">
<MemberSignature Language="C#" Value="public System.Net.Cache.RequestCachePolicy CachePolicy { set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.Cache.RequestCachePolicy CachePolicy" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.Cache.RequestCachePolicy</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the cache policy for the underlying <see cref="T:System.Net.WebRequest" /> object.</para>
</summary>
</Docs>
</Member>
<Member MemberName="Credentials">
<MemberSignature Language="ILASM" Value=".property class System.Net.ICredentials Credentials { public hidebysig virtual specialname void set_Credentials(class System.Net.ICredentials value) }" />
<MemberSignature Language="C#" Value="public override System.Net.ICredentials Credentials { set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.ICredentials Credentials" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.ICredentials</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>
<para>A <see cref="T:System.Net.ICredentials" /> instance containing the credentials.</para>
</value>
<example>
<para>The following example sets credentials for the virtual directory "http://localhost/bookstore/inventory.xml". There
is no
output from this example.</para>
<code lang="C#">using System;
using System.Net;
using System.Xml;
public class App {
public static void Main() {
XmlTextReader xtReader =
new XmlTextReader("http://localhost/" +
"bookstore/inventory.xml");
NetworkCredential netCredential =
new NetworkCredential("username",
"password",
"domain");
XmlUrlResolver xResolver = new XmlUrlResolver();
xResolver.Credentials = netCredential;
xtReader.XmlResolver= xResolver;
}
}
</code>
<para>The following example associates different credentials
with different URIs and adds the credentials to a credential cache. The
credentials can then be used to check authentication for different URIs
regardless of the original source of the XML. There is no output from this
example.</para>
<code lang="C#">using System;
using System.Net;
using System.Xml;
public class App {
public static void Main() {
XmlTextReader xtReader =
new XmlTextReader("http://localhost/" +
"bookstore/inventory.xml");
NetworkCredential netCredential1 =
new NetworkCredential("username1",
"password1",
"domain1");
NetworkCredential netCredential2 =
new NetworkCredential("username2",
"password2",
"domain2");
CredentialCache credCache = new CredentialCache();
credCache.Add( new Uri("http://www.contoso.com/"),
"Basic",
netCredential1);
credCache.Add( new Uri("http://app.contoso.com/"),
"Basic",
netCredential2);
XmlUrlResolver xResolver = new XmlUrlResolver();
xResolver.Credentials = credCache;
xtReader.XmlResolver= xResolver;
}
}
</code>
</example>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>If the virtual directory does not require authentication, this property does not need to be set. Otherwise, the credentials of the user must be supplied.</para>
<para>Different credentials can be associated with different URIs and added to a credential cache. The credentials can then be used to check authentication for different URIs, regardless of the original source of the XML.</para>
<para>The following C# code shows how to set the <see cref="P:System.Xml.XmlUrlResolver.Credentials" /> property to a credential cache.</para>
<code>NetworkCredential myCred = new NetworkCredential(UserName,SecurelyStoredPassword,Domain);
CredentialCache myCache = new CredentialCache();
myCache.Add(new Uri("http://www.contoso.com/"), "Basic", myCred);
myCache.Add(new Uri("http://app.contoso.com/"), "Basic", myCred);
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = myCache;</code>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Sets credentials used to authenticate Web requests.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="GetEntity">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual object GetEntity(class System.Uri absoluteUri, string role, class System.Type ofObjectToReturn)" />
<MemberSignature Language="C#" Value="public override object GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance object GetEntity(class System.Uri absoluteUri, string role, class System.Type ofObjectToReturn) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="absoluteUri" Type="System.Uri" />
<Parameter Name="role" Type="System.String" />
<Parameter Name="ofObjectToReturn" Type="System.Type" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentNullException">
<paramref name="absoluteUri" /> is <see langword="null" />.</exception>
<exception cref="T:System.Xml.XmlException">
<paramref name="ofObjectToReturn" /> is not <see langword="null" /> or <see langword="typeof" />(<see cref="T:System.IO.Stream" qualify="true" />).</exception>
<exception cref="T:System.NullReferenceException">
<paramref name="absoluteUri" /> is <see langword="null" />.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method is used when the caller wants to map a given URI into an object containing the actual resource that the URI represents.</para>
<para>For the asynchronous version of this method, see <see cref="M:System.Xml.XmlUrlResolver.GetEntityAsync(System.Uri,System.String,System.Type)" />.</para>
<block subset="none" type="note">
<para>Your application can mitigate memory Denial of Service threats to the <see cref="M:System.Xml.XmlUrlResolver.GetEntity(System.Uri,System.String,System.Type)" /> method by implementing IStream to limit the number of bytes read. This helps to guard against situations where malicious code attempts to pass an infinite stream of bytes to the <see cref="M:System.Xml.XmlUrlResolver.GetEntity(System.Uri,System.String,System.Type)" /> method.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Maps a URI to an object containing the actual resource.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.IO.Stream" /> object or null if a type other than stream is specified.</para>
</returns>
<param name="absoluteUri">
<attribution license="cc4" from="Microsoft" modified="false" />The URI returned from <see cref="M:System.Xml.XmlResolver.ResolveUri(System.Uri,System.String)" />.</param>
<param name="role">
<attribution license="cc4" from="Microsoft" modified="false" />The current implementation 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.</param>
<param name="ofObjectToReturn">
<attribution license="cc4" from="Microsoft" modified="false" />The type of object to return. The current implementation only returns <see cref="T:System.IO.Stream" /> objects.</param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="GetEntityAsync">
<MemberSignature Language="C#" Value="public override System.Threading.Tasks.Task&lt;object&gt; GetEntityAsync (Uri absoluteUri, string role, Type ofObjectToReturn);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Threading.Tasks.Task`1&lt;object&gt; GetEntityAsync(class System.Uri absoluteUri, string role, class System.Type ofObjectToReturn) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.DebuggerStepThrough</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.AsyncStateMachine(typeof(System.Xml.XmlUrlResolver/&lt;GetEntityAsync&gt;c__async0))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task&lt;System.Object&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="absoluteUri" Type="System.Uri" />
<Parameter Name="role" Type="System.String" />
<Parameter Name="ofObjectToReturn" Type="System.Type" />
</Parameters>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Asynchronously maps a URI to an object containing the actual resource.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.IO.Stream" /> object or null if a type other than stream is specified.</para>
</returns>
<param name="absoluteUri">
<attribution license="cc4" from="Microsoft" modified="false" />The URI returned from <see cref="M:System.Xml.XmlResolver.ResolveUri(System.Uri,System.String)" />.</param>
<param name="role">
<attribution license="cc4" from="Microsoft" modified="false" />The current implementation 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.</param>
<param name="ofObjectToReturn">
<attribution license="cc4" from="Microsoft" modified="false" />The type of object to return. The current implementation only returns <see cref="T:System.IO.Stream" /> objects.</param>
</Docs>
</Member>
<Member MemberName="Proxy">
<MemberSignature Language="C#" Value="public System.Net.IWebProxy Proxy { set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.IWebProxy Proxy" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.IWebProxy</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the network proxy for the underlying <see cref="T:System.Net.WebRequest" /> object.</para>
</summary>
</Docs>
</Member>
<Member MemberName="ResolveUri">
<MemberSignature Language="C#" Value="public override Uri ResolveUri (Uri baseUri, string relativeUri);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Uri ResolveUri(class System.Uri baseUri, string relativeUri) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Uri</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="baseUri" Type="System.Uri" />
<Parameter Name="relativeUri" Type="System.String" />
</Parameters>
<Docs>
<since version=".NET 2.0" />
<exception cref="T:System.ArgumentException">
<paramref name="relativeUri" /> is <see langword="null" />.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The absolute URI can be used as the base URI for any subsequent requests for entities that are relative to this URI.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Resolves the absolute URI from the base and relative URIs.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.Uri" /> representing the absolute URI, or null if the relative URI cannot be resolved.</para>
</returns>
<param name="baseUri">
<attribution license="cc4" from="Microsoft" modified="false" />The base URI used to resolve the relative URI.</param>
<param name="relativeUri">
<attribution license="cc4" from="Microsoft" modified="false" />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.</param>
</Docs>
</Member>
</Members>
<TypeExcluded>0</TypeExcluded>
</Type>