Files
dotnet-bot 4c5e6261a7 Initial commit
_   _ _____ _____   ____            _        _
   | \ | | ____|_   _| |  _ \ ___   ___| | _____| |
   |  \| |  _|   | |   | |_) / _ \ / __| |/ / __| |
  _| |\  | |___  | |   |  _ < (_) | (__|   <\__ \_|
 (_)_| \_|_____| |_|   |_| \_\___/ \___|_|\_\___(_)
2016-05-03 00:07:31 +02: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);
}
}
}
}