2005-10-05 Chris Toshok <toshok@ximian.com>
authorChris Toshok <toshok@novell.com>
Wed, 5 Oct 2005 19:58:10 +0000 (19:58 -0000)
committerChris Toshok <toshok@novell.com>
Wed, 5 Oct 2005 19:58:10 +0000 (19:58 -0000)
* ConfigurationLockCollection.cs: add NIE'd AttributeList
property.

* ConfigurationConverterBase.cs: add MonoTODO'd CanConvertFrom and
CanConvertTo methods.

* ConfigurationSectionGroup.cs: add NIE'd IsDeclared property.

* ProtectedConfigurationSection.cs: add NIE'd properties.

* ConfigurationElementCollection.cs: add MonoTODO'd IsReadOnly
and SetReadOnly methods, and have then chain up to the base class.

* KeyValueConfigurationCollection.cs: add the class level
ConfigurationCollectionAttribute, and add a NIE'ed Properties
property.

* ProviderSettingsCollection.cs: add the class level
ConfigurationCollectionAttribute, and add a "new" keyword to the
this property.  Also, nuke the Provider's property.

* SectionInformation.cs: add some NEI'd properties.

* ConfigurationSection.cs (ResetModified): leave the MonoTODO, but
chain up to base class's method instead of throwing NIE.

* ConnectionStringSettingsCollection.cs: add the class-level
ConfigurationCollectionAttribute, and add the unimplemented
Properties property.

* ConfigurationErrorsException.cs: flesh this out, and add a
pragma to disable the obsolete warnings from our base class.

* ProviderSettings.cs: add unimplemented Properties property.

* ConfigurationElement.cs: remove unnecessary
EvaluationInformation.

* InternalConfigurationRoot.cs: add unimplemented IsDesignTime
property.

* ConfigurationProperty.cs: add a missing ctor.

* AppSettingsSection.cs: add missing "override" keyword.

* ConnectionStringsSection.cs: remove override.

* ConfigurationSectionCollection.cs: AllKeys -> Keys, and add
unimplemented GetObjectData override.

* ConfigurationSectionGroupCollection.cs: same.

* ConfigurationCollectionAttribute.cs: add missing CollectionType
property.

svn path=/trunk/mcs/; revision=51301

mcs/class/System.Configuration/System.Configuration/ConfigurationErrorsException.cs

index abb3642fc7e6f97770673bdb251536c44068e3e1..0cbed8443236dee6f2caf764558415837271288f 100644 (file)
@@ -1,10 +1,11 @@
 //
 // System.Configuration.ConfigurationErrorsException.cs
 //
-// Author:
-//   Duncan Mak (duncan@ximian.com)
+// Authors:
+//     Duncan Mak (duncan@ximian.com)
+//     Chris Toshok (toshok@ximian.com)
 //
-// (C) Ximian, Inc.  http://www.ximian.com
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
 //
 
 //
 using System;
 using System.Globalization;
 using System.Runtime.Serialization;
+using System.Collections;
 using System.Xml;
 
 namespace System.Configuration 
 {
+/* disable the obsolete warnings about ConfigurationException */
+#pragma warning disable 618
+
        [Serializable]
        public class ConfigurationErrorsException : ConfigurationException
        {
@@ -46,13 +51,15 @@ namespace System.Configuration
                }
                
                public ConfigurationErrorsException (string message)
-                       : base (message)
                {
+                       bareMessage = message;
                }
 
                protected ConfigurationErrorsException (SerializationInfo info, StreamingContext context)
                        : base (info, context)
                {
+                       filename = info.GetString ("ConfigurationErrors_Filename");
+                       line = info.GetInt32 ("ConfigurationErrors_Line");
                }
 
                public ConfigurationErrorsException (string message, Exception inner)
@@ -61,49 +68,57 @@ namespace System.Configuration
                }
 
                public ConfigurationErrorsException (string message, XmlNode node)
-                       : base (message, GetFilename (node), GetLineNumber (node))
+                       : this (message, null, GetFilename (node), GetLineNumber (node))
                {
                }
 
                public ConfigurationErrorsException (string message, Exception inner, XmlNode node)
-                       : base (message, inner, GetFilename (node), GetLineNumber (node))
+                       : this (message, inner, GetFilename (node), GetLineNumber (node))
                {
                }
                
                public ConfigurationErrorsException (string message, XmlReader reader)
-                       : base (message, GetFilename (reader), GetLineNumber (reader))
+                       : this (message, null, GetFilename (reader), GetLineNumber (reader))
                {
                }
 
                public ConfigurationErrorsException (string message, Exception inner, XmlReader reader)
-                       : base (message, inner, GetFilename (reader), GetLineNumber (reader))
+                       : this (message, inner, GetFilename (reader), GetLineNumber (reader))
                {
                }
                
                public ConfigurationErrorsException (string message, string filename, int line)
-                       : base (message, filename, line)
+                       : this (message, null, filename, line)
                {
                }
 
                public ConfigurationErrorsException (string message, Exception inner, string filename, int line)
-                       : base (message, inner, filename, line)
+                       : base (message, inner)
                {
+                       bareMessage = message;
+                       this.filename = filename;
+                       this.line = line;
                }
                
                //
                // Properties
                //
-/*             public override string BareMessage
+               public new string BareMessage
                {
                        get  { return bareMessage; }
                }
 
-               public override string Filename
+               public ICollection Errors
+               {
+                       get { throw new NotImplementedException (); }
+               }
+
+               public new string Filename
                {
                        get { return filename; }
                }
                
-               public override int Line
+               public new int Line
                {
                        get { return line; }
                }
@@ -118,7 +133,6 @@ namespace System.Configuration
                                return baseMsg + " (" + f + l + ")";
                        }
                }
-*/
                //
                // Methods
                //
@@ -138,7 +152,7 @@ namespace System.Configuration
                                return 0;
                }
 
-               static string GetFilename (XmlNode node)
+               public static string GetFilename (XmlNode node)
                {
                        if (!(node is IConfigXmlNode))
                                return String.Empty;
@@ -146,7 +160,7 @@ namespace System.Configuration
                        return ((IConfigXmlNode) node).Filename;
                }
 
-               static int GetLineNumber (XmlNode node)
+               public static int GetLineNumber (XmlNode node)
                {
                        if (!(node is IConfigXmlNode))
                                return 0;
@@ -154,12 +168,16 @@ namespace System.Configuration
                        return ((IConfigXmlNode) node).LineNumber;
                }
                
-/*             public override void GetObjectData (SerializationInfo info, StreamingContext context)
+               public override void GetObjectData (SerializationInfo info, StreamingContext context)
                {
                        base.GetObjectData (info, context);
-                       info.AddValue ("filename", filename);
-                       info.AddValue ("line", line);
+                       info.AddValue ("ConfigurationErrors_Filename", filename);
+                       info.AddValue ("ConfigurationErrors_Line", line);
                }
-               */
+
+               string bareMessage = "";
+               string filename = "";
+               int line = 0;
        }
+#pragma warning restore
 }