473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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
Sep 11 '08 #1
1 1599

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/Blog/cns!A68482B9628A842A!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" <Ja************@discussions.microsoft.comwrote in
message news:A8**********************************@microsof t.com...
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

Sep 12 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: rdcpro | last post by:
In reading MSDN docs on creating custom Configuration sections, I found this page: ...
3
by: rdcpro | last post by:
Hi all, I've been building a nifty deserializing configuration handler that I use in conjunction with my web.config in an ASP.NET web app. This is working quite well, but I'm planning on...
1
by: Paloma GarcĂ­a | last post by:
Dear all, I have created personalized configuration sections in my web project following the instructions described in this page...
6
by: Tabi | last post by:
Hi, I want to create a custom section in my web.config that can hold my custom values. I created a section in web.config as written below. <configSections> <section name="myCustomSection"...
3
by: Jason Richmeier | last post by:
Is it possible to create a custom configuration file (other than app.config) that can be processed by classes in the System.Configuration namespace? I have seen a ton of articles that talk about...
6
by: Jeff Hegedus | last post by:
I have a dll that requires some configuration data. I put the configuration data in a custom configuration section in a config file that is loaded in the installation folder of the dll. If I...
3
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am trying to implement a configuration section in web.config and was wondering if I could do it without writing a handeler. I tried in the <configSections>. <sectionGroup name="Domains" >...
2
by: Smithers | last post by:
I have a Windows Forms application that implements a plug-in architecture whereby required assemblies are identified and loaded dynamically. Here are the relevant classes: A = application =...
0
by: =?Utf-8?B?a2FobGlu?= | last post by:
Hello, I am trying to create a custom SettingsProvider that works with the standard configuration sections that are provided by .NET. What I'm trying to achieve is that when the application...
4
balabaster
by: balabaster | last post by:
Okay, I decided that I needed to understand the whole custom configuration file bits and so I've spent some time playing around with it. It seems (in the most) relatively straight forward. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.