G
Guest
I am passing a System.Type parameter into a method. I would like to create an object of that type from the System.Type.
for example
public CreateAnObject( System.Type objectType)
{
m_MemberObject = new "The class represented by objectType";
}
and called by
CreateAnObject(typeof(someClass));
Underlying reason is I want to pass a class in a custom attribute so I cannot pass an instantiated object (must be a class or a constant)
Thanks
Martin
for example
public CreateAnObject( System.Type objectType)
{
m_MemberObject = new "The class represented by objectType";
}
and called by
CreateAnObject(typeof(someClass));
Underlying reason is I want to pass a class in a custom attribute so I cannot pass an instantiated object (must be a class or a constant)
Thanks
Martin