X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FSystem.Configuration%2FConfigXmlDocument.cs;h=1ab98591990dbc8668c681db8452119b74526f55;hb=69f207ee9e4f440e66e98bf5f685807f6527c39d;hp=c75e24c0ac6237e1c86772f4dcdee4a41854fc2b;hpb=f99ce750ee781a2584e849a0264300fa4d99aaaa;p=mono.git diff --git a/mcs/class/System/System.Configuration/ConfigXmlDocument.cs b/mcs/class/System/System.Configuration/ConfigXmlDocument.cs index c75e24c0ac6..1ab98591990 100644 --- a/mcs/class/System/System.Configuration/ConfigXmlDocument.cs +++ b/mcs/class/System/System.Configuration/ConfigXmlDocument.cs @@ -27,6 +27,9 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if CONFIGURATION_DEP +using System.Configuration.Internal; +#endif using System.IO; using System.Security; using System.Security.Permissions; @@ -38,6 +41,9 @@ namespace System.Configuration { [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)] public sealed class ConfigXmlDocument : XmlDocument, IConfigXmlNode +#if CONFIGURATION_DEP + , IConfigErrorInfo +#endif { XmlTextReader reader; string fileName; @@ -83,8 +89,12 @@ namespace System.Configuration public override void Load (string filename) { XmlTextReader rd = new XmlTextReader (filename); - rd.MoveToContent (); - LoadSingleElement (filename, rd); + try { + rd.MoveToContent (); + LoadSingleElement (filename, rd); + } finally { + rd.Close (); + } } public void LoadSingleElement (string filename, XmlTextReader sourceReader) @@ -114,10 +124,31 @@ namespace System.Configuration } } +#if CONFIGURATION_DEP + string System.Configuration.Internal.IConfigErrorInfo.Filename { + get { return Filename; } + } + + int System.Configuration.Internal.IConfigErrorInfo.LineNumber { + get { return LineNumber; } + } +#endif + + string IConfigXmlNode.Filename { + get { return Filename; } + } + + int IConfigXmlNode.LineNumber { + get { return LineNumber; } + } + // // Wrappers for Xml* that just provide file name and line number addition // class ConfigXmlAttribute : XmlAttribute, IConfigXmlNode +#if CONFIGURATION_DEP + , IConfigErrorInfo +#endif { string fileName; int lineNumber; @@ -151,6 +182,9 @@ namespace System.Configuration } class ConfigXmlCDataSection : XmlCDataSection, IConfigXmlNode +#if CONFIGURATION_DEP + , IConfigErrorInfo +#endif { string fileName; int lineNumber; @@ -211,6 +245,9 @@ namespace System.Configuration } class ConfigXmlElement : XmlElement, IConfigXmlNode +#if CONFIGURATION_DEP + , IConfigErrorInfo +#endif { string fileName; int lineNumber; @@ -244,6 +281,9 @@ namespace System.Configuration } class ConfigXmlText : XmlText, IConfigXmlNode +#if CONFIGURATION_DEP + , IConfigErrorInfo +#endif { string fileName; int lineNumber;