// TODO: This can probably be reworked with the inner type concept. public ContainedType(Field.InnerType innerType, DetailsStore store) { if (innerType.Primitive != null) { category = ContainedTypeCategory.Primitive; Type = CommonDetailsUtils.GetCapitalisedFqnTypename(innerType.Primitive); rawType = innerType.Primitive; } else if (innerType.UserType != null) { category = ContainedTypeCategory.UserDefined; Type = CommonDetailsUtils.GetCapitalisedFqnTypename(innerType.UserType.QualifiedName); rawType = innerType.UserType.QualifiedName; } else if (innerType.EnumType != null) { category = ContainedTypeCategory.Enum; Type = CommonDetailsUtils.GetCapitalisedFqnTypename(innerType.EnumType.QualifiedName); rawType = innerType.EnumType.QualifiedName; } else { throw new ArgumentException("Malformed inner type."); } }
public ContainedType(TypeReferenceRaw typeReferenceRaw, HashSet <string> enumSet) { category = enumSet.Contains(typeReferenceRaw.TypeName) ? ContainedTypeCategory.Enum : SchemaFunctionMappings.BuiltInTypeWithSchemaFunctions.Contains(typeReferenceRaw.TypeName) ? ContainedTypeCategory.Primitive : ContainedTypeCategory.UserDefined; Type = CommonDetailsUtils.GetFqnTypeFromTypeReference(typeReferenceRaw); rawType = typeReferenceRaw.TypeName; }