Open GoogleCodeExporter opened 8 years ago
Ok, for what it's worth: running the following prior to any action will
correctly initialize generic types as far as I can see.
private void PopulateTypes(Type t)
{
foreach (object mt in RuntimeTypeModel.Default.GetTypes())
{
MetaType theType = mt as MetaType;
if (null != theType)
{
if (theType.Type == t)
return;
}
}
Type objType = typeof(object);
List<Type> inheritanceTree = new List<Type>();
do
{
inheritanceTree.Insert(0, t);
t = t.BaseType;
} while (null != t && t != objType);
if (!inheritanceTree.Any(gt => gt.IsGenericType))
return;
int n = 100;
for (int i = 0; i < inheritanceTree.Count - 1; i++)
{
Type type = inheritanceTree[i];
MetaType mt = RuntimeTypeModel.Default.Add(type, true);
mt.AddSubType(n++, inheritanceTree[i + 1]);
}
}
Original comment by mennod...@gmail.com
on 17 Sep 2013 at 9:59
Original issue reported on code.google.com by
mennod...@gmail.com
on 30 Aug 2013 at 11:44