473,218 Members | 1,465 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,218 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 3582
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: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.