FrzzMan,
Keep in mind that if you return a boxed value as an object the client code
will still have to cast it to the appropriate type before it can be used.
If the client code knows what types to expect anyway, this is only a
syntactic annoyance, but there is also unboxing overhead to consider.
I would lead towards creating a class with all the configuration properties
exposed, and use those properties. Something along these lines on the
client side:
// The constructor reads the config file and loads the values
AppConfiguration config = new AppConfiguration(strConfigFileName);
// Now use the values, for example:
if (config.LoggingEnabled = true) {
logger.EmailEnabled = true;
logger.EmailAddress = config.LogEmailAddress;
}
--Bob
"FrzzMan[at]vnOCzone.com" <"FrzzMan[at]vnOCzone.com"> wrote in message
news:Oh**************@TK2MSFTNGP11.phx.gbl...
Thanks, I'll try this.
What I'm trying to do is coding a configuration class. This function
will get the variable name, find the value of that variable and its type.
Then convert the value to suitable type (as the value are always string,
it's in the XML file).