Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

boostr.in questions - Question:ConfigurationElementCollection with primitive types


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?

asked Sep 13, 2013 in ANDROID by rajesh
edited Sep 12, 2013
0 votes
12 views



Related Hot Questions



Government Jobs Opening


...