public RootObject CallFactory(string packageName, string className, string objectName)
{
Dictionary<string, Dictionary<string, Type>> packages;
Dictionary<string, Type> types;
Type type;
if (FactoryTypes.TryGetValue(packageName, out packages)) {
if (packages.TryGetValue(className, out types)) {
if (types.TryGetValue(objectName, out type)) {
return (RootObject)type.GetConstructor(Type.EmptyTypes).Invoke(null);
}
}
}
throw new Exception("There is no factory defined for " + packageName + ":" + className + ":" + objectName + ".");
}