473,394 Members | 1,700 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.

configuration element and collection

Hi,

I am doing some complex configuration handling, and I have similiar setup:

<DataSchema version="1.0">
<modules name="Assets">
<tables>
<tables description="" singular="" plural="" name="City" />
</tables>
</modules>
<modules name="Assets2">
<tables>
<tables description="" singular="" plural="" name="City" />
</tables>
</modules>
</DataSchema>

it goes deeper but it's not the point, I'd like to find out the module from
table element.
in collections I have defined following indexer:
new public ElementType this[string name]
{
get { return ( ElementType )base.BaseGet(name); }
}
which returns correct element, like this:
Module m1 = section.Modules["Assets"];
Module m2 = section.Modules["Assets2"];
Table t1 = m1.Tables["City"];
Table t2 = m2.Tables["City"];

so far so good, however I'd like to get the siblings, or collection from
element:
Module m = table.ParentCollection.Parent;
TablesCollection tc = table.ParentCollection;

since this is quite easily human readable, I can't see a reason of this not
beeing possible, and yet, I can't find an apropraite method, to use or
overload from ConfigurationElement

Anyone?

CUIN Kaczy
Dec 12 '05 #1
1 3589
OK, unless it's obvious, forget it.
I did what I need in TablesCollection, thus I had the access to all Table
siblings.
From design POV it is even better, to have parent setup all his children
properly.

CUIN Kaczy

Użytkownik "Andrzej Kaczmarczyk" <ak**********@visualsystems.com.pl> napisał
w wiadomo¶ci news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi,

I am doing some complex configuration handling, and I have similiar setup:

<DataSchema version="1.0">
<modules name="Assets">
<tables>
<tables description="" singular="" plural="" name="City" />
</tables>
</modules>
<modules name="Assets2">
<tables>
<tables description="" singular="" plural="" name="City" />
</tables>
</modules>
</DataSchema>

it goes deeper but it's not the point, I'd like to find out the module
from table element.
in collections I have defined following indexer:
new public ElementType this[string name]
{
get { return ( ElementType )base.BaseGet(name); }
}
which returns correct element, like this:
Module m1 = section.Modules["Assets"];
Module m2 = section.Modules["Assets2"];
Table t1 = m1.Tables["City"];
Table t2 = m2.Tables["City"];

so far so good, however I'd like to get the siblings, or collection from
element:
Module m = table.ParentCollection.Parent;
TablesCollection tc = table.ParentCollection;

since this is quite easily human readable, I can't see a reason of this
not beeing possible, and yet, I can't find an apropraite method, to use or
overload from ConfigurationElement

Anyone?

CUIN Kaczy

Dec 12 '05 #2

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

Similar topics

3
by: Robert | last post by:
I have an application with custom configuration sections in it's app.config file. Here's a shortened excerpt: <monitors> <monitor...
3
by: Florida Coder | last post by:
I have the need to store some application specific configuration data to be used by a class library and or a windows service. I would like to do this in a fashion similar to the way we do with...
2
by: gcrasher | last post by:
What is the easiest way to store a collection of strings using the MS Configuration Block? I am using XML serializer. I tried having an ArrayList as a property in the class I was serializing, but...
5
by: Water Cooler v2 | last post by:
I know that we can add a single name value entry in app.config or web.config in the configuration/configSettings/appSettings section like so: <add key="key" value="value" /> Question: I want...
4
by: Michael Lang | last post by:
I was basically wanting to know how to use the System.Configuration namespace to be able to load an arbitrary number of unknown attributes on an element in a custom section in the .config into a...
1
by: =?Utf-8?B?RGljaw==?= | last post by:
My Windows Application stores its configuration values in app.config and these are typed and accessed via corresponding classes, something like this... <configSections> <section name="Watcher"/>...
0
by: michael1778 | last post by:
I have having trouble to get the following code (related to custom configuration .net 2.0) to work. Can anyone please help? Custom config file: <?xml version="1.0" encoding="utf-8"?>...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.