private void DerivePolymorphicDescriptors(FieldInfo pField)
{
SimplScope scopeAttribute = XmlTools.GetAnnotation<SimplScope>(pField);
String scopeAttributeValue = scopeAttribute == null ? null : scopeAttribute.TranslationScope;
if (!String.IsNullOrEmpty(scopeAttributeValue))
{
if (!ResolveScopeAttribute(scopeAttributeValue))
{
unresolvedScopeAnnotation = scopeAttributeValue;
declaringClassDescriptor.RegisterUnresolvedScopeAnnotationFD(this);
}
}
SimplClasses classesAttribute = XmlTools.GetAnnotation<SimplClasses>(pField);
Type[] classesAttributeValue = classesAttribute == null ? null : classesAttribute.Classes;
if ((classesAttribute != null) && classesAttributeValue.Length > 0)
{
unresolvedClassesAnnotation = classesAttributeValue;
declaringClassDescriptor.RegisterUnresolvedScopeAnnotationFD(this);
InitPolymorphicClassDescriptorsList(classesAttributeValue.Length);
foreach (Type thatType in classesAttributeValue)
{
ClassDescriptor classDescriptor = ClassDescriptor.GetClassDescriptor(thatType);
RegisterPolymorphicDescriptor(classDescriptor);
polymorphClasses.Put(classDescriptor.TagName, classDescriptor.DescribedClass);
}
}
}