Hierarchy structures
<p>I have a requirement to represent a hierarchical structure in a class within c#. 
The "leaf" nodes of the hierarchy need to be typed as either "Class A" or "Class B".  </p>

<p>How do I achieve this. </p>

<p>Ok more detail</p>

<p>The classes involved are as follows</p>

<p>FieldClass - this has a bunch of properties</p>

<p>SegmentClass - a segment is a collection of fields</p>

<p>GroupClass - a group is a collection of segments or groups (ie there is a recursive relationship)</p>

<p>The nodes on the hierarchy can be either "segments" or "groups". So at the root level this a collection where the classes can be either of type segment or group. </p>
