Author: toshok
Date: 2005-12-12 12:48:24 -0500 (Mon, 12 Dec 2005)
New Revision: 54250
Modified:
trunk/mcs/class/System.Configuration/System.Configuration/AppSettingsSection.cs
trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
Log:
2005-12-12 Chris Toshok <[EMAIL PROTECTED]>
* AppSettingsSection.cs (DeserializeElement): provide rather naive
version of the file="" handling. It's enough to make our tests
pass.
Modified:
trunk/mcs/class/System.Configuration/System.Configuration/AppSettingsSection.cs
===================================================================
---
trunk/mcs/class/System.Configuration/System.Configuration/AppSettingsSection.cs
2005-12-12 17:21:00 UTC (rev 54249)
+++
trunk/mcs/class/System.Configuration/System.Configuration/AppSettingsSection.cs
2005-12-12 17:48:24 UTC (rev 54250)
@@ -67,14 +67,22 @@
return Settings.IsModified ();
}
- [MonoTODO ("Read file attribute")]
+ [MonoTODO ("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 */
base.DeserializeElement (reader,
serializeCollectionKey);
if (File != "") {
- /* deserialize from the file */
- throw new NotImplementedException ();
+ try {
+ Stream s = System.IO.File.OpenRead
(File);
+ XmlReader subreader = new XmlTextReader
(s);
+ base.DeserializeElement (subreader,
serializeCollectionKey);
+ s.Close ();
+ }
+ catch {
+ // nada, we just ignore a
missing/unreadble file
+ }
}
}
Modified: trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
===================================================================
--- trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
2005-12-12 17:21:00 UTC (rev 54249)
+++ trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
2005-12-12 17:48:24 UTC (rev 54250)
@@ -1,3 +1,9 @@
+2005-12-12 Chris Toshok <[EMAIL PROTECTED]>
+
+ * AppSettingsSection.cs (DeserializeElement): provide rather naive
+ version of the file="" handling. It's enough to make our tests
+ pass.
+
2005-12-11 Chris Toshok <[EMAIL PROTECTED]>
* ConnectionStringsSection.cs (..cctor): use "" instead of null
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches