Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
AnswerRe: System.Globalization.CultureInfo Pin
Ian Shlasko11-Aug-10 4:09
Ian Shlasko11-Aug-10 4:09 
QuestionConstraints taking either types in generics Pin
dashingsidds11-Aug-10 3:34
dashingsidds11-Aug-10 3:34 
AnswerRe: Constraints taking either types in generics Pin
Ennis Ray Lynch, Jr.11-Aug-10 3:52
Ennis Ray Lynch, Jr.11-Aug-10 3:52 
AnswerRe: Constraints taking either types in generics Pin
kapax511-Aug-10 3:52
kapax511-Aug-10 3:52 
GeneralRe: Constraints taking either types in generics Pin
dashingsidds11-Aug-10 4:00
dashingsidds11-Aug-10 4:00 
GeneralRe: Constraints taking either types in generics Pin
Luc Pattyn11-Aug-10 4:14
sitebuilderLuc Pattyn11-Aug-10 4:14 
GeneralRe: Constraints taking either types in generics Pin
kapax511-Aug-10 4:24
kapax511-Aug-10 4:24 
AnswerRe: Constraints taking either types in generics Pin
Łukasz Nowakowski11-Aug-10 4:00
Łukasz Nowakowski11-Aug-10 4:00 
You could try to simulate this with inheritance. You could do:
class MyGenericBase<T>{
    public virtual T DoSomeStuff() { ... }
}

class MyGeneric<T> : MyGenericBase<T>
    where T : MyClass1
{
    public override T DoSomeStuff { ... }
}

class MyGeneric1<T> : MyGenericBase<T>
    where T : IMyInterface
{
    public override T DoSomeStuff() { ... }
}

I'm pretty sure, that you wan't be able to give derived class with the same identifier (but check it, compiler will tell you Wink | ;-) )

And question is: "Why would you want to do it?". Seems like your design isn't perfect.
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.

AnswerRe: Constraints taking either types in generics Pin
Covean11-Aug-10 5:49
Covean11-Aug-10 5:49 
GeneralRe: Constraints taking either types in generics Pin
PIEBALDconsult11-Aug-10 16:45
mvePIEBALDconsult11-Aug-10 16:45 
GeneralRe: Constraints taking either types in generics Pin
Covean11-Aug-10 22:31
Covean11-Aug-10 22:31 
AnswerRe: Constraints taking either types in generics Pin
PIEBALDconsult11-Aug-10 16:37
mvePIEBALDconsult11-Aug-10 16:37 
Questionsql express installing when I call it from my program, but does not work!! Pin
lourensG11-Aug-10 3:04
lourensG11-Aug-10 3:04 
AnswerRe: sql express installing when I call it from my program, but does not work!! Pin
PIEBALDconsult11-Aug-10 3:07
mvePIEBALDconsult11-Aug-10 3:07 
GeneralRe: sql express installing when I call it from my program, but does not work!! [modified] Pin
lourensG11-Aug-10 3:15
lourensG11-Aug-10 3:15 
GeneralRe: sql express installing when I call it from my program, but does not work!! Pin
Dave Kreskowiak11-Aug-10 5:56
mveDave Kreskowiak11-Aug-10 5:56 
GeneralRe: sql express installing when I call it from my program, but does not work!! Pin
lourensG11-Aug-10 20:54
lourensG11-Aug-10 20:54 
GeneralRe: sql express installing when I call it from my program, but does not work!! Pin
Dave Kreskowiak12-Aug-10 2:11
mveDave Kreskowiak12-Aug-10 2:11 
Questionarray to array copy Pin
varsh1211-Aug-10 0:12
varsh1211-Aug-10 0:12 
AnswerRe: array to array copy Pin
Nuri Ismail11-Aug-10 0:24
Nuri Ismail11-Aug-10 0:24 
AnswerRe: array to array copy Pin
PIEBALDconsult11-Aug-10 3:08
mvePIEBALDconsult11-Aug-10 3:08 
QuestionMoving the multiple files from one to another location Pin
annie_bel10-Aug-10 23:33
annie_bel10-Aug-10 23:33 
AnswerRe: Moving the multiple files from one to another location Pin
Nuri Ismail10-Aug-10 23:48
Nuri Ismail10-Aug-10 23:48 
AnswerRe: Moving the multiple files from one to another location Pin
Islorvat11-Aug-10 0:51
Islorvat11-Aug-10 0:51 
GeneralRe: Moving the multiple files from one to another location [modified] Pin
annie_bel11-Aug-10 1:26
annie_bel11-Aug-10 1:26 

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.