Click here to Skip to main content
15,913,115 members
Home / Discussions / C#
   

C#

 
GeneralRe: Linq - Join Pin
treuveni18-Aug-10 5:52
treuveni18-Aug-10 5:52 
QuestionRegular Expressions [modified] Pin
moein.serpico14-Aug-10 21:39
moein.serpico14-Aug-10 21:39 
AnswerRe: Regular Expressions Pin
Luc Pattyn14-Aug-10 22:26
sitebuilderLuc Pattyn14-Aug-10 22:26 
AnswerRe: Regular Expressions Pin
PIEBALDconsult15-Aug-10 8:14
mvePIEBALDconsult15-Aug-10 8:14 
QuestionDirect access to the webCam of the machine on .net framework Pin
Yanshof14-Aug-10 20:32
Yanshof14-Aug-10 20:32 
AnswerRe: Direct access to the webCam of the machine on .net framework Pin
JF201514-Aug-10 23:08
JF201514-Aug-10 23:08 
QuestionGenerics question Pin
Pete Burkindine14-Aug-10 12:31
Pete Burkindine14-Aug-10 12:31 
GeneralRe: Generics question Pin
harold aptroot14-Aug-10 12:47
harold aptroot14-Aug-10 12:47 
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 12:55
Pete Burkindine14-Aug-10 12:55 
GeneralRe: Generics question Pin
harold aptroot14-Aug-10 13:26
harold aptroot14-Aug-10 13:26 
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 13:40
Pete Burkindine14-Aug-10 13:40 
GeneralRe: Generics question Pin
harold aptroot14-Aug-10 13:56
harold aptroot14-Aug-10 13:56 
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 14:20
Pete Burkindine14-Aug-10 14:20 
GeneralRe: Generics question Pin
harold aptroot14-Aug-10 14:29
harold aptroot14-Aug-10 14:29 
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 15:22
Pete Burkindine14-Aug-10 15:22 
GeneralRe: Generics question Pin
PIEBALDconsult14-Aug-10 15:43
mvePIEBALDconsult14-Aug-10 15:43 
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 15:50
Pete Burkindine14-Aug-10 15:50 
GeneralRe: Generics question Pin
PIEBALDconsult14-Aug-10 16:38
mvePIEBALDconsult14-Aug-10 16:38 
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 16:58
Pete Burkindine14-Aug-10 16:58 
GeneralRe: Generics question Pin
harold aptroot14-Aug-10 17:03
harold aptroot14-Aug-10 17:03 
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 17:10
Pete Burkindine14-Aug-10 17:10 
GeneralRe: Generics question Pin
PIEBALDconsult14-Aug-10 17:22
mvePIEBALDconsult14-Aug-10 17:22 
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 17:25
Pete Burkindine14-Aug-10 17:25 
GeneralRe: Generics question Pin
PIEBALDconsult14-Aug-10 18:19
mvePIEBALDconsult14-Aug-10 18:19 
No, not really.


But OK, so you have a class that contains a Dictionary of some type, but you don't want to specify that type in the usual way.
You tried passing in the type, but that didn't work. You could pass in a delegate to the constructor to use, but internally store objects.

What does the class do with the items in the Dictionary?

If another class passes the items back out, you could make that method generic.

sometype x = manager.GetItem<sometype> ( itemname ) ;

It still requires casting, and could involve boxing/unboxing, but only if you use value types.


I think I may have done something similar a while back, I'll have to take a look at what I did.
GeneralRe: Generics question Pin
Pete Burkindine14-Aug-10 18:31
Pete Burkindine14-Aug-10 18:31 

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.