내 응용 프로그램의 구성을 저장하기 위해 System.Configuration 네임 스페이스 유형을 사용하고 있습니다. 해당 구성의 일부로 원시 형식 컬렉션 (System.Double)을 저장해야합니다.기본 유형이있는 ConfigurationElementCollection
[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
}
}
나는이 문제가 발생하는 첫 번째 사람이야 상상도 할 수 있습니다 : 다음과 같은 만들 과잉처럼 보인다. 어떤 아이디어?