Jo Shields 3c1f479b9d Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
2015-04-07 09:35:12 +01:00

22 lines
842 B
C#

using System.Runtime.Versioning;
using System.Threading.Tasks;
namespace System.Xml
{
public partial class XmlUrlResolver : XmlResolver {
// Maps a URI to an Object containing the actual resource.
[ResourceConsumption(ResourceScope.Machine)]
[ResourceExposure(ResourceScope.Machine)]
public override async Task<Object> GetEntityAsync(Uri absoluteUri, string role, Type ofObjectToReturn) {
if (ofObjectToReturn == null || ofObjectToReturn == typeof(System.IO.Stream) || ofObjectToReturn == typeof(System.Object)) {
return await DownloadManager.GetStreamAsync(absoluteUri, _credentials, _proxy, _cachePolicy).ConfigureAwait(false);
}
else {
throw new XmlException(Res.Xml_UnsupportedClass, string.Empty);
}
}
}
}