System.Configuration 名前空間タイプを使用して、アプリケーションの構成を保存しています。その構成の一部として、プリミティブ型 (System.Double) のコレクションを格納する必要があります。以下を作成するのはやり過ぎのようです。
[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
}
}
私がこの問題に遭遇した最初の人だとは想像できません。何か案は?