Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

instantiate type c#

// determine type here
var type = typeof(MyClass);

// create an object of the type
var obj = (MyClass)Activator.CreateInstance(type);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #instantiate #type
ADD COMMENT
Topic
Name
4+3 =