#if NET_2_0
using System;
+using System.ComponentModel;
using System.Collections.Specialized;
using System.Xml;
using System.IO;
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);
return Settings.IsModified ();
}
- [MonoTODO ("file path? do we use a System.Configuration api for opening it? do we keep it open? do we open it writable?")]
+ [MonoInternalNote ("file path? do we use a System.Configuration api for opening it? do we keep it open? do we open it writable?")]
protected internal override void DeserializeElement (XmlReader reader, bool serializeCollectionKey)
{
/* need to do this so we pick up the File attribute */
if (File != "") {
try {
Stream s = System.IO.File.OpenRead (File);
- XmlReader subreader = new XmlTextReader (s);
+ XmlReader subreader = new ConfigXmlTextReader (s, File);
base.DeserializeElement (subreader, serializeCollectionKey);
s.Close ();
}
}
}
- [MonoTODO]
protected internal override object GetRuntimeObject ()
{
- return base.GetRuntimeObject();
+ KeyValueInternalCollection col = new KeyValueInternalCollection ();
+
+ foreach (string key in Settings.AllKeys) {
+ KeyValueConfigurationElement ele = Settings[key];
+ col.Add (ele.Key, ele.Value);
+ }
+
+ if (!ConfigurationManager.ConfigurationSystem.SupportsUserConfig)
+ col.SetReadOnly ();
+
+ return col;
}
}
}