private IEnumerable<PropertyData> FindCatelFields(Type type)
{
// CTL-212: Generic types are not supported for FieldInfo.GetValue
if (type.ContainsGenericParametersEx())
{
return new PropertyData[] { };
}
PreventWrongDeclaredFields(type);
// Fields - actual addition
var foundFields = new List<PropertyData>();
var fields = new List<FieldInfo>();
fields.AddRange(type.GetFieldsEx(BindingFlagsHelper.GetFinalBindingFlags(true, true, false)));
foreach (var field in fields)
{
if (field.FieldType == typeof(PropertyData))
{
var propertyValue = (field.IsStatic ? field.GetValue(null) : field.GetValue(this)) as PropertyData;
if (propertyValue != null)
{
foundFields.Add(propertyValue);
}
}
}
return foundFields;
}