فهرست منبع

2006-01-09 Chris Toshok <[email protected]>

	* ConfigurationManager.cs (AppSettings): just return
	AppSettingsSection.GetRuntimeObject() here.

	* AppSettingsSection.cs: fix the "file" property to match dumper
	output.
	(GetRuntimeObject): this returns a KeyValueInternalCollection in
	MS's implementation.


svn path=/trunk/mcs/; revision=55266
Chris Toshok 20 سال پیش
والد
کامیت
06b2a491c2

+ 11 - 3
mcs/class/System.Configuration/System.Configuration/AppSettingsSection.cs

@@ -29,6 +29,7 @@
 
 #if NET_2_0
 using System;
+using System.ComponentModel;
 using System.Collections.Specialized;
 using System.Xml;
 using System.IO;
@@ -44,7 +45,7 @@ namespace System.Configuration {
                 static AppSettingsSection ()
                 {
                         _propFile = new ConfigurationProperty ("file", typeof(string), "",
-							       null, null, ConfigurationPropertyOptions.None);
+							       new StringConverter(), null, ConfigurationPropertyOptions.None);
                         _propSettings = new ConfigurationProperty ("", typeof(KeyValueConfigurationCollection), null, 
 								   null, null, ConfigurationPropertyOptions.IsDefaultCollection);
 
@@ -118,10 +119,17 @@ namespace System.Configuration {
 			}
 		}
 
-		[MonoTODO]
 		protected internal override object GetRuntimeObject ()
 		{
-			return base.GetRuntimeObject();
+			KeyValueInternalCollection col = new KeyValueInternalCollection ();
+				
+			foreach (string key in Settings.AllKeys) {
+				col.Add (Settings[key].Key, Settings[key].Value);
+			}
+				
+			col.SetReadOnly ();
+
+			return col;
 		}
 	}
 }

+ 10 - 0
mcs/class/System.Configuration/System.Configuration/ChangeLog

@@ -1,3 +1,13 @@
+2006-01-09  Chris Toshok  <[email protected]>
+
+	* ConfigurationManager.cs (AppSettings): just return
+	AppSettingsSection.GetRuntimeObject() here.
+
+	* AppSettingsSection.cs: fix the "file" property to match dumper
+	output.
+	(GetRuntimeObject): this returns a KeyValueInternalCollection in
+	MS's implementation.
+
 2006-01-09  Chris Toshok  <[email protected]>
 
 	* ElementInformation.cs (Validator): if propertyInfo == null,

+ 1 - 9
mcs/class/System.Configuration/System.Configuration/ConfigurationManager.cs

@@ -167,15 +167,7 @@ namespace System.Configuration {
 		public static NameValueCollection AppSettings {
 			get {
 				AppSettingsSection appsettings = (AppSettingsSection) GetSection ("appSettings");
-				KeyValueInternalCollection col = new KeyValueInternalCollection ();
-				
-				foreach (string key in appsettings.Settings.AllKeys) {
-					col.Add (appsettings.Settings[key].Key, appsettings.Settings[key].Value);
-				}
-				
-				col.SetReadOnly ();
-
-				return col;
+				return (NameValueCollection)appsettings.GetRuntimeObject ();
 			}
 		}