Question : Instanciate a "Type"

Hi!

I want to know if it is possible to create an instance of class from a type.

Example:

public void (Type type){
  //Dictionnary is a Dictionary<Type, Interface that all "type" we receive implements
  Dictionnary[type] = createNewInstanceType();
}

I'm not sure I will really use that but I need to know if it is possible

Answer : Instanciate a "Type"

System.Type ThisType = System.Type.GetType("MySpecialType", true);
Result = (MySpecialType)System.Activator.CreateInstance(ThisType);
Random Solutions  
 
programming4us programming4us