I'm working with the System.Configuration namespace types to store configuration for my application. I need to store a collection of primitive types (System.Double) as part of that configuration. It seems like overkill to create the following:
[ConfigurationCollection(typeof(double), AddItemName="TemperaturePoint",
CollectionType=ConfigurationElementCollectionType.BasicMap)]
class DoubleCollection : ConfigurationElementCollection
{
protected override ConfigurationElement CreateNewElement()
{
return // Do I need to create a custom ConfigurationElement that wraps a double?
}
protected override object GetElementKey(ConfigurationElement element)
{
return // Also not sure what to do here
}
}
I can't imagine I'm the first person to encounter this problem. Any ideas?