Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.Xml / System / Xml / XmlNullResolver.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="XmlNullResolver.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">[....]</owner>
6 //------------------------------------------------------------------------------
7
8 #if !SILVERLIGHT
9 using System.Net;
10 #endif
11
12 namespace System.Xml {
13     internal class XmlNullResolver : XmlResolver {
14         public static readonly XmlNullResolver Singleton = new XmlNullResolver();
15
16         // Private constructor ensures existing only one instance of XmlNullResolver
17         private XmlNullResolver() { }
18
19         public override Object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn) {
20             throw new XmlException(Res.Xml_NullResolver, string.Empty);
21         }
22
23 #if !SILVERLIGHT
24         public override ICredentials Credentials {
25             set { /* Do nothing */ }
26         }
27 #endif
28     }
29 }