private List<string> CollectExactTypeNames(List<string> rootTypeNames)
{
var allowedTypeNames = new List<string>();
foreach (string typeName in rootTypeNames)
{
if (ActiveSchema.NodeTypes[typeName] == null)
throw new ApplicationException(String.Concat("Unknown NodeType in ReferenceField: ", typeName));
if (!allowedTypeNames.Contains(typeName))
allowedTypeNames.Add(typeName);
}
var index = 0;
while (index < allowedTypeNames.Count)
{
foreach (var childType in ActiveSchema.NodeTypes[allowedTypeNames[index]].Children)
allowedTypeNames.Add(childType.Name);
index++;
}
return allowedTypeNames;
}