//
// Authors:
// Duncan Mak (duncan@ximian.com)
+// Chris Toshok (toshok@ximian.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
public sealed class AppSettingsSection : ConfigurationSection
{
KeyValueConfigurationCollection values;
-
+ const string configFile = "file";
+
+ private static ConfigurationPropertyCollection _properties;
+ private static readonly ConfigurationProperty _propFile;
+
+ static AppSettingsSection ()
+ {
+ _properties = new ConfigurationPropertyCollection ();
+ _propFile = new ConfigurationProperty (configFile,
+ typeof(string),
+ "",
+ ConfigurationPropertyOptions.None);
+
+ _properties.Add (_propFile);
+ }
+
public AppSettingsSection ()
{
}
[MonoTODO ("Read file attribute")]
protected internal override void DeserializeElement (XmlReader reader, bool serializeCollectionKey)
{
- Settings.DeserializeElement (reader, serializeCollectionKey);
+ if (File != "") {
+ /* deserialize from the file */
+ throw new NotImplementedException ();
+ }
}
protected internal override void Reset (ConfigurationElement parentSection)
Settings.Reset (psec.Settings);
}
+ [MonoTODO]
protected internal override string SerializeSection (
ConfigurationElement parent, string name, ConfigurationSaveMode mode)
{
- AppSettingsSection psec = parent as AppSettingsSection;
- if (psec != null)
- return Settings.SerializeSection (psec.Settings, name, mode);
- else
- return Settings.SerializeSection (null, name, mode);
+ if (File == "") {
+ return base.SerializeSection (parent, name, mode);
+ }
+ else {
+ throw new NotImplementedException ();
+ }
}
- [MonoTODO]
+ [ConfigurationProperty ("file", DefaultValue = "")]
public string File {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
+ get { return (string)base [configFile]; }
+ set { base [configFile] = value; }
}
+ [ConfigurationProperty ("", Options = ConfigurationPropertyOptions.IsDefaultCollection)]
public KeyValueConfigurationCollection Settings {
get {
if (values == null)
return values;
}
}
+
+ protected internal override ConfigurationPropertyCollection Properties {
+ get {
+ return _properties;
+ }
+ }
+
+ [MonoTODO]
+ protected internal override object GetRuntimeObject ()
+ {
+ return base.GetRuntimeObject();
+ }
}
}
#endif