public static object LoadInitializer(Type type, XmlElement initializerElement)
{
ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(XmlElement) });
if (null == constructor)
{
throw new ApplicationException(type + " must provide a public constructor taking a System.Xml.XmlElement!");
}
try
{
return constructor.Invoke(new object[] { initializerElement });
}
catch (TargetInvocationException x)
{
throw x.InnerException;
}
}