标签:ict addm method creat instance cti gen tor count
int count = Convert.ToInt32(objType.GetProperty("Count").GetValue(value, null));
var ss= objType.GenericTypeArguments[0];
var listType = typeof(List<>).MakeGenericType(ss);
var list = Activator.CreateInstance(listType);
var addMethod = listType.GetMethod("Add");
object oItem = objType.GetProperty("Item").GetValue(value, new object[] { i });
object obj = Copy(oItem);
addMethod.Invoke((object)list, new object[] { obj });
标签:ict addm method creat instance cti gen tor count
原文地址:http://www.cnblogs.com/caiyanlin/p/6003167.html