here’s the code,
Type tbn = Type.GetType(dii.DictionaryName);
DictionaryXmlInfo4BaseDictionary<tbn>.AddDictionaryXmlInfo((message));//error
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t use generics like that. Generics are meant to be used for types known at compile time.
You can do it with reflection – getting the generic
DictionaryXmlInfo4BaseDictionarytype definition, creating the closed type usingType.MakeGenericType, then callingAddDictionaryXmlInfoon it again by reflection… but it’s relatively painful.