471,348 Members | 1,285 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 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 3520
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Water Cooler v2 | last post: by
4 posts views Thread by Michael Lang | last post: by
1 post views Thread by =?Utf-8?B?RGljaw==?= | last post: by
1 post views Thread by Ronak mishra | last post: by

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.