public static bool ReadType(XmlElement xml, string attribute, ref Type value, bool mandatory)
{
string s = GetAttribute(xml, attribute, mandatory);
if (s == null)
{
return(false);
}
Type type;
try
{
type = ScriptCompiler.FindTypeByName(s, false);
}
catch
{
Console.WriteLine("Could not parse Type attribute '{0}' in element '{1}'", attribute, xml.Name);
return(false);
}
if (type == null)
{
Console.WriteLine("Could not find Type '{0}'", s);
return(false);
}
value = type;
return(true);
}