Microsoft
Software
Hardware
Network
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("MySpe
cialType",
true);
Result = (MySpecialType)System.Acti
vator.Crea
teInstance
(ThisType)
;
Random Solutions
Loading Multiple RSS feeds into specific Divs
installing the package
Mac OS 10.4.10 into Intel Core2Duo Desktop PC
Autotext in word 2007
Cannot delete inactive datastore and other issues
Zen cart NavMainLink color change
how do i fix (the command cannot be performed because the dialog box is open
Excel VBA - append ID for each row to results
Batch File Script Issue
how to backup SBS 2008 to folder