Complex configuration

08/19/09

Permalink 10:58:05 pm, by truewill Email , 99 words, 73 views   English (US)
Categories: .NET, WTF

Complex configuration

I’m working on a small project at home, and I decided to add a custom configuration section to the App.config. If it weren’t for Derik Whittaker’s article (thanks Derik!), it’s unlikely that I would have figured it out.

So after importing one reference (System.configuration), descending from three different classes, overriding two methods, applying two attributes (one of them multiple times), making multiple casts, and repeatedly hardcoding the same strings, I can now parse six lines of XML.

It would be simpler to write a custom class and use LINQ to XML to load it. This is absurd.

Comments, Pingbacks:

Comment from: Chris Sutton [Visitor] Email
That is a lot of code just to read something that is already "human readable" :)
PermalinkPermalink 08/20/09 @ 23:26

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))
The name truewill is composed of two other words. What is the SECOND word?

Development Central

Development Central is the blog of Bill Sorensen, a professional software developer. Much of this will relate to C#, .NET, and OOP in general.

Disclaimer
These postings are provided "AS IS" with no warranties and confer no rights.

Search

Categories

Linkblog

b2evolution

contributors

XML Feeds

What is RSS?

Who's Online?

  • Guest Users: 5

powered by b2evolution free blog software