{
public class KeyValueConfigurationElement: ConfigurationElement
{
-// ConfigurationPropertyCollection properties;
-
+ static ConfigurationProperty keyProp;
+ static ConfigurationProperty valueProp;
+ static ConfigurationPropertyCollection properties;
+
+ static KeyValueConfigurationElement ()
+ {
+ keyProp = new ConfigurationProperty ("key", typeof (string), "", ConfigurationPropertyOptions.IsKey);
+ valueProp = new ConfigurationProperty ("value", typeof (string), "");
+
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (keyProp);
+ properties.Add (valueProp);
+ }
+
internal KeyValueConfigurationElement ()
{
}
-
+
public KeyValueConfigurationElement (string key, string value)
{
- this["key"] = key;
- this ["value"] = value;
+ this[keyProp] = key;
+ this[valueProp] = value;
}
[ConfigurationProperty ("key", DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)]
public string Key {
- get { return (string) this["key"]; }
+ get { return (string) this[keyProp]; }
}
[ConfigurationProperty ("value", DefaultValue = "")]
public string Value {
- get { return (string) this["value"]; }
- set { this ["value"] = value; }
+ get { return (string) this[valueProp]; }
+ set { this [valueProp] = value; }
}
-
-/* protected internal override void Init ()
+
+ [MonoTODO]
+ protected internal override void Init ()
{
}
protected internal override ConfigurationPropertyCollection Properties {
get { return properties; }
}
-*/ }
+ }
}
#endif