C2017-002 Allow inheritance of step data elements
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user