![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Custom Configuration Sections... This may have been addressed in another post but I was unable to find what I was looking for. I am trying to create a custom configuration section that is element-centric instead of attribute-centric (mostly out of preference). For example... <Date> <Year>2008</Year> <Month>09</Month> <Day>11</Day> </Date> ....instead of... <Date Year="2008" Month="09" Day="11" /> If I am reading the documentation correctly, it sounds like this can be done using the .NET 2.0 configuration API. However, either all of the examples using the .NET 2.0 configuration API that I have found use an attribute-centric approach or the examples use the older (pre .NET 2.0 configuration API) to create the custom configuration section. Any ideas? Thank you, Jason |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Custom Configuration Sections... Are you using something like this? public sealed class MyHandler : IConfigurationSectionHandler { public object Create(object parent, object configContext, System.Xml.XmlNode section) { }} In you are, then you can read out the xml (coming to you as "section") any way you chose. // The section handler interprets and processes the settings defined in // XML tags within a specific portion of a Web.config file and returns an // appropriate configuration object .... based on the configuration settings. // ( above exert from http://msdn.microsoft.com/library/de...onhandlers.asp ) // also see http://support.microsoft.com/default...b;en-us;309045 // Article ID : 309045 I have some code at: http://sholliday.spaces.live.com/Blo...842A!126.entry if you want to look at it. It's not specific to this issue, but I do use it the IConfigurationSectionHandler there. If you're doing something else, throw some more detail out there. "Jason Richmeier" <JasonRichmeier@xxxxxx> wrote in message news:A8D97959-8912-4A8F-9673-6FD2E02986CB@xxxxxx Quote: > This may have been addressed in another post but I was unable to find what > I > was looking for. > > I am trying to create a custom configuration section that is > element-centric > instead of attribute-centric (mostly out of preference). > > For example... > > <Date> > <Year>2008</Year> > <Month>09</Month> > <Day>11</Day> > </Date> > > ...instead of... > > <Date Year="2008" Month="09" Day="11" /> > > If I am reading the documentation correctly, it sounds like this can be > done > using the .NET 2.0 configuration API. However, either all of the examples > using the .NET 2.0 configuration API that I have found use an > attribute-centric approach or the examples use the older (pre .NET 2.0 > configuration API) to create the custom configuration section. > > Any ideas? > > Thank you, > > Jason |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Accessing custom types output from custom cmdlet's in C# GUI | PowerShell | |||
| Reading Config Sections | PowerShell | |||
| (My) Computer directory/folder... how do I show the drives in groups/sections ? | Vista General | |||
| Why no looping of songs or Video sections in Media Players? | Vista General | |||