Click here to Skip to main content
15,891,661 members
Home / Discussions / C#
   

C#

 
GeneralRe: About Reflecting and generics Pin
PozzaVecia14-Feb-12 11:42
PozzaVecia14-Feb-12 11:42 
AnswerRe: About Reflecting and generics Pin
Luc Pattyn14-Feb-12 12:08
sitebuilderLuc Pattyn14-Feb-12 12:08 
GeneralRe: About Reflecting and generics Pin
PozzaVecia14-Feb-12 12:29
PozzaVecia14-Feb-12 12:29 
AnswerRe: About Reflecting and generics Pin
Luc Pattyn14-Feb-12 12:41
sitebuilderLuc Pattyn14-Feb-12 12:41 
RantRe: About Reflecting and generics Pin
PozzaVecia14-Feb-12 12:58
PozzaVecia14-Feb-12 12:58 
GeneralRe: About Reflecting and generics Pin
GParkings14-Feb-12 23:44
GParkings14-Feb-12 23:44 
GeneralRe: About Reflecting and generics Pin
PozzaVecia15-Feb-12 0:10
PozzaVecia15-Feb-12 0:10 
GeneralRe: About Reflecting and generics Pin
GParkings15-Feb-12 0:59
GParkings15-Feb-12 0:59 
aside from
C#
myClass<ICar,IMoto>
you can't without some nasty reflection (detailed in other replies)

My question would be why you need to use generics for this.

With the interface driven approach the ICar has an Imoto in a strategy pattern. your myClass could be simply written to work with ICar instances regardless of the concrete types.

this would require the ICar interface to be well designed but since your myClass clas is designed to work with any combination of car and moto then it should be easy to determine the common functionality to place on the ICar and IMoto interfaces

why pass concrete types when a common interface will suffice?
Pedis ex oris
Quidquid latine dictum sit, altum sonatur

GeneralRe: About Reflecting and generics Pin
jschell14-Feb-12 13:40
jschell14-Feb-12 13:40 
AnswerRe: About Reflecting and generics Pin
AspDotNetDev14-Feb-12 13:00
protectorAspDotNetDev14-Feb-12 13:00 
GeneralRe: About Reflecting and generics Pin
PozzaVecia14-Feb-12 21:20
PozzaVecia14-Feb-12 21:20 
AnswerRe: About Reflecting and generics Pin
AspDotNetDev14-Feb-12 21:49
protectorAspDotNetDev14-Feb-12 21:49 
GeneralRe: About Reflecting and generics Pin
PozzaVecia14-Feb-12 22:26
PozzaVecia14-Feb-12 22:26 
GeneralRe: About Reflecting and generics Pin
AspDotNetDev15-Feb-12 7:09
protectorAspDotNetDev15-Feb-12 7:09 
GeneralRe: About Reflecting and generics Pin
AspDotNetDev14-Feb-12 21:52
protectorAspDotNetDev14-Feb-12 21:52 
AnswerRe: About Reflecting and generics Pin
BobJanova14-Feb-12 23:20
BobJanova14-Feb-12 23:20 
GeneralRe: About Reflecting and generics Pin
PozzaVecia14-Feb-12 23:29
PozzaVecia14-Feb-12 23:29 
GeneralRe: About Reflecting and generics Pin
BobJanova15-Feb-12 0:50
BobJanova15-Feb-12 0:50 
GeneralRe: About Reflecting and generics Pin
PozzaVecia15-Feb-12 1:24
PozzaVecia15-Feb-12 1:24 
GeneralRe: About Reflecting and generics Pin
BobJanova15-Feb-12 1:59
BobJanova15-Feb-12 1:59 
GeneralRe: About Reflecting and generics Pin
PozzaVecia15-Feb-12 2:30
PozzaVecia15-Feb-12 2:30 
GeneralRe: About Reflecting and generics Pin
BobJanova15-Feb-12 2:37
BobJanova15-Feb-12 2:37 
GeneralRe: About Reflecting and generics Pin
GParkings15-Feb-12 2:52
GParkings15-Feb-12 2:52 
GeneralRe: About Reflecting and generics Pin
GParkings15-Feb-12 2:54
GParkings15-Feb-12 2:54 
GeneralRe: About Reflecting and generics Pin
PozzaVecia15-Feb-12 3:09
PozzaVecia15-Feb-12 3:09 

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.