根据泛型的类型,创建泛型类型的集合对象

如集合对象IEnumerable<>

var type= typeof(TreeNode);           

 Activator.CreateInstance(typeof(IEnumerable<>).MakeGenericType(new Type[] { type }), BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, new object[] { this, type }, null);

posted @ 2011-10-24 13:26  小芒果  阅读(519)  评论(0编辑  收藏  举报