public static TypeEnum GetComponentType(string typestr, string parentName)
{
TypeEnum ctype;
switch (typestr)
{
case "field": ctype = TypeEnum.Field; break;
case "group": ctype = TypeEnum.Group; break;
case "component": ctype = TypeEnum.Component; break;
default: throw new MessageParseError("unknown component in msg: " + parentName);
}
return ctype;
}