{
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[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; }
}
-
+
+ [MonoTODO]
protected internal override void Init ()
{
- properties = new ConfigurationPropertyCollection ();
- properties.Add (new ConfigurationProperty ("key", typeof(string), string.Empty, ConfigurationPropertyOptions.IsKey));
- properties.Add (new ConfigurationProperty ("value", typeof(string), string.Empty));
}
protected internal override ConfigurationPropertyCollection Properties {