public void GenerateInheritedFields()
{
foreach (Structure inheritedStructure in Interfaces)
{
foreach (StructureElement inheritedElement in inheritedStructure.Elements)
{
StructureElement correspondingElement = null;
foreach (StructureElement element in Elements)
{
if (element.Name.Equals(inheritedElement.Name))
{
correspondingElement = element;
break;
}
}
if (correspondingElement == null) // no correspondance found => create that element
{
appendElements(inheritedElement.Duplicate() as StructureElement);
}
else // correspondace found => update that element
{
correspondingElement.TypeName = inheritedElement.TypeName;
}
}
}
}