public string CheckChildrenTypeConsistence()
{
var result = new StringBuilder();
result.AppendLine("Path\tType\tChild name\tChild type\tReason");
foreach (var node in NodeEnumerator.GetNodes(this.Path, ExecutionHint.ForceRelationalEngine))
{
var parentGC = node.Parent as GenericContent;
if (parentGC == null)
continue;
var checkResult = parentGC.CheckAllowedChildType(node);
if(checkResult != TypeAllow.Allowed)
{
result.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\r\n", parentGC.Path, parentGC.NodeType.Name, node.Name, node.NodeType.Name,
String.Join(", ", parentGC.GetAllowedChildTypeNames()), checkResult);
result.AppendLine();
}
}
return result.ToString();
}