C2017-002 Allow inheritance of step data elements

This commit is contained in:
2017-01-10 13:01:58 +00:00
parent 9a699e7e40
commit 4c4396e8c8
4 changed files with 160 additions and 29 deletions

View File

@@ -1882,11 +1882,26 @@ namespace VEPROMS.CSLA.Library
{
get
{
if ((int)MyContent.Type < 20000) return null;
int typ = (int)MyContent.Type - 20000;
foreach (StepData sd in ActiveFormat.PlantFormat.FormatData.StepDataList)
{
if (sd.Index == typ) return sd;
}
// Handle inheritance (step data may not be in current format, may inherit from parents:
IFormatOrFormatInfo parentFormat = ActiveFormat.PlantFormat.FormatData.MyParentFormat;
while (parentFormat != null)
{
vlnIndexedFormatList<StepData> InheritedList = parentFormat.PlantFormat.FormatData.StepDataList;
if (InheritedList != null)
{
foreach (StepData sdi in InheritedList)
{
if (sdi.Index == typ) return sdi;
}
}
parentFormat = parentFormat.PlantFormat.FormatData.MyParentFormat;
}
return null;
}
}