configuration element and collection

  • Thread starter Thread starter Andrzej Kaczmarczyk
  • Start date Start date
A

Andrzej Kaczmarczyk

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
 
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
 
Back
Top