Generic Class & Type.GetType()

前端 未结 4 1785
慢半拍i
慢半拍i 2021-02-14 11:54

Bit of a puzzler, I have a generic class

public abstract class MyClass : UserControl
{

}

and I have got a type like this

<         


        
4条回答
  •  [愿得一人]
    2021-02-14 12:14

    You create new objects using reflection:

    type.GetConstructor(new Type[]{}).Invoke(new object[]{});
    

提交回复
热议问题