Click here to Skip to main content
16,012,843 members
Home / Discussions / C#
   

C#

 
GeneralRe: instantiate generic list Pin
Pete O'Hanlon19-Jun-08 4:27
mvePete O'Hanlon19-Jun-08 4:27 
GeneralRe: instantiate generic list Pin
leppie19-Jun-08 4:33
leppie19-Jun-08 4:33 
GeneralRe: instantiate generic list Pin
Pete O'Hanlon19-Jun-08 4:42
mvePete O'Hanlon19-Jun-08 4:42 
GeneralRe: instantiate generic list Pin
leppie19-Jun-08 5:32
leppie19-Jun-08 5:32 
GeneralRe: instantiate generic list Pin
Pete O'Hanlon19-Jun-08 6:02
mvePete O'Hanlon19-Jun-08 6:02 
GeneralRe: instantiate generic list Pin
S. Senthil Kumar19-Jun-08 6:20
S. Senthil Kumar19-Jun-08 6:20 
GeneralRe: instantiate generic list Pin
Pete O'Hanlon19-Jun-08 21:30
mvePete O'Hanlon19-Jun-08 21:30 
AnswerRe: instantiate generic list [modified] Pin
leppie19-Jun-08 3:46
leppie19-Jun-08 3:46 
Look at Type.MakeGenericType().

You will have to do something like:
Assembly asm = Assembly.LoadFrom(@"C:\Documents and Settings\someDll.dll");
Type type = asm.GetType(someClass);
Type ltype = typeof(List<>  ).MakeGenericType(type);
IList list = Activator.CreateInstance(ltype) as IList;


Note: The bolded types are not generic types, you can use a generic IList if the type or its parent or interfaces are known at compile time.

[update] Or simply use an ArrayList or List<object> [update]

xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 alpha 4a out now (29 May 2008)

modified on Thursday, June 19, 2008 1:24 PM

QuestionText search Pin
ellllllllie19-Jun-08 0:30
ellllllllie19-Jun-08 0:30 
AnswerRe: Text search Pin
Ashfield19-Jun-08 1:18
Ashfield19-Jun-08 1:18 
QuestionUsing SSH proxy in my application Pin
Mazdak19-Jun-08 0:27
Mazdak19-Jun-08 0:27 
AnswerRe: Using SSH proxy in my application Pin
leppie19-Jun-08 3:49
leppie19-Jun-08 3:49 
Questionhelp asterisk Pin
waseemakhtar18-Jun-08 23:56
waseemakhtar18-Jun-08 23:56 
AnswerRe: help asterisk Pin
N a v a n e e t h19-Jun-08 1:17
N a v a n e e t h19-Jun-08 1:17 
QuestionCopying files from one network path to another network path in Window Service Pin
rahulrmetadesi18-Jun-08 23:29
rahulrmetadesi18-Jun-08 23:29 
AnswerRe: Copying files from one network path to another network path in Window Service Pin
leppie19-Jun-08 3:53
leppie19-Jun-08 3:53 
QuestionNew MDI child is hidden Pin
Yosh_18-Jun-08 23:21
professionalYosh_18-Jun-08 23:21 
AnswerRe: New MDI child is hidden Pin
Pete O'Hanlon19-Jun-08 1:54
mvePete O'Hanlon19-Jun-08 1:54 
Questionproblem with increment decimal value Pin
Mr.Kode18-Jun-08 22:56
Mr.Kode18-Jun-08 22:56 
AnswerRe: problem with increment decimal value Pin
Matthew Butler18-Jun-08 23:04
Matthew Butler18-Jun-08 23:04 
QuestionRetrieving the COM class factory for component with CLSID {} failed Pin
Tejal Bhavsar18-Jun-08 21:27
Tejal Bhavsar18-Jun-08 21:27 
AnswerRe: Retrieving the COM class factory for component with CLSID {} failed Pin
leppie18-Jun-08 21:47
leppie18-Jun-08 21:47 
GeneralRe: Retrieving the COM class factory for component with CLSID {} failed Pin
Tejal Bhavsar18-Jun-08 22:42
Tejal Bhavsar18-Jun-08 22:42 
GeneralRe: Retrieving the COM class factory for component with CLSID {} failed Pin
leppie19-Jun-08 4:36
leppie19-Jun-08 4:36 
Questionnumeric problem on some pcs Pin
Xmen Real 18-Jun-08 21:06
professional Xmen Real 18-Jun-08 21:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.