Honestly, don't know, why do you need it (if you want save key/value pairs you can do it without Tridion configuration handlers).
But if you really want it, I've made fast example.
For next xml:
<My.Tridion.CustomResolving>
<Keys>
<add key="title"
</Keys>
</My.Tridion.CustomResolving>
You need to have something next:
public class NameValueSectionHandler : CentralizedConfigurationSection
{
private const string _keyCollectionConfigurationProperty = "Keys";
public override string Name
{
get
{
return "My.Tridion.CustomResolving";
}
}
/// <summary>
/// Gets the Keys.
/// </summary>
[ConfigurationProperty(_keyCollectionConfigurationProperty)]
public KeyCollection KeyCollection
{
get
{
return (KeyCollection) this[_keyCollectionConfigurationProperty];
}
}
}
public class KeyCollection : ConfigurationElementCollection
{
protected override ConfigurationElement CreateNewElement()
{
return new KeySettings();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((KeySettings)element).Key;
}
}
public class KeySettings : ConfigurationElement
{
private const string _keyAttributeName = "Key";
private const string _valueAttributeName = "Value";
[ConfigurationProperty(_keyAttributeName)]
public string Key
{
get
{
return (string) this[_keyAttributeName];
}
set
{
this[_keyAttributeName] = value;
}
}
[ConfigurationProperty(_valueAttributeName)]
public string Value
{
get
{
return (string) this[_valueAttributeName];
}
set
{
this[_valueAttributeName] = value;
}
}
}
(CentralizedConfigurationSection is from Tridion.Configuration)
Almost forgotten...
After that you need do something like:
NameValueSectionHandler handler = Tridion.Configuration.ConfigurationManager.GetSection<NameValueSectionHandler>("My.Tridion.CustomResolving");
With help of this handler - you can read your configuration.