Click here to Skip to main content
15,887,267 members
Home / Discussions / C#
   

C#

 
QuestionAbstracts: can I do better than this? Pin
MollyTheCoder30-Dec-09 4:45
MollyTheCoder30-Dec-09 4:45 
AnswerRe: Abstracts: can I do better than this? Pin
Luc Pattyn30-Dec-09 4:56
sitebuilderLuc Pattyn30-Dec-09 4:56 
GeneralRe: Abstracts: can I do better than this? Pin
MollyTheCoder30-Dec-09 5:22
MollyTheCoder30-Dec-09 5:22 
AnswerRe: Abstracts: can I do better than this? Pin
#realJSOP30-Dec-09 5:14
mve#realJSOP30-Dec-09 5:14 
AnswerRe: Abstracts: can I do better than this? Pin
DaveyM6930-Dec-09 5:20
professionalDaveyM6930-Dec-09 5:20 
AnswerRe: Abstracts: can I do better than this? Pin
Paulo Zemek30-Dec-09 5:23
mvaPaulo Zemek30-Dec-09 5:23 
AnswerRe: Abstracts: can I do better than this? Pin
Eddy Vluggen30-Dec-09 6:56
professionalEddy Vluggen30-Dec-09 6:56 
AnswerRe: Abstracts: can I do better than this? [modified] Pin
PIEBALDconsult30-Dec-09 7:20
mvePIEBALDconsult30-Dec-09 7:20 
Is the casting required at all? Even if SetDevice is overloaded for each type there shouldn't be a problem should there? And if not, then you still don't need to cast to each type.

Edit: I just tried it and I see the problem.


More information about SetDevice would be helpful.


And, as Luc said, use is rather than comparing types.



Edit: Or perhaps SetDevice should handle determining which type of device it was passed:

private static void
SetDev
(
    DevBase Dev
)
{
    System.Console.WriteLine ( "DevBase" ) ;

    if ( Dev is Dev1 ) SetDev ( (Dev1) Dev ) ;
    else if ( Dev is Dev2 ) SetDev ( (Dev2) Dev ) ;

    return ;
}


modified on Wednesday, December 30, 2009 2:01 PM

GeneralRe: Abstracts: can I do better than this? Pin
MollyTheCoder30-Dec-09 7:43
MollyTheCoder30-Dec-09 7:43 
GeneralRe: Abstracts: can I do better than this? Pin
PIEBALDconsult30-Dec-09 7:52
mvePIEBALDconsult30-Dec-09 7:52 
GeneralRe: Abstracts: can I do better than this? Pin
MollyTheCoder30-Dec-09 7:58
MollyTheCoder30-Dec-09 7:58 
GeneralRe: Abstracts: can I do better than this? Pin
pbalaga30-Dec-09 8:12
pbalaga30-Dec-09 8:12 
GeneralRe: Abstracts: can I do better than this? [modified] Pin
ProtoBytes30-Dec-09 8:35
ProtoBytes30-Dec-09 8:35 
GeneralRe: Abstracts: can I do better than this? Pin
MollyTheCoder30-Dec-09 8:36
MollyTheCoder30-Dec-09 8:36 
GeneralRe: Abstracts: can I do better than this? Pin
PIEBALDconsult5-Apr-10 15:33
mvePIEBALDconsult5-Apr-10 15:33 
GeneralRe: Abstracts: can I do better than this? Pin
MollyTheCoder5-Apr-10 17:00
MollyTheCoder5-Apr-10 17:00 
GeneralRe: Abstracts: can I do better than this? Pin
PIEBALDconsult5-Apr-10 17:39
mvePIEBALDconsult5-Apr-10 17:39 
AnswerRe: Abstracts: can I do better than this? Pin
petercrab30-Dec-09 17:00
petercrab30-Dec-09 17:00 
QuestionHow to use in c# SqlHierarchyId.GetDescendant(null,null)? [modified] Pin
dimitarmarinov30-Dec-09 2:21
dimitarmarinov30-Dec-09 2:21 
QuestionInvoke a function every time that a function is been added to my event Pin
bonzaiholding30-Dec-09 1:17
bonzaiholding30-Dec-09 1:17 
AnswerRe: Invoke a function every time that a function is been added to my event Pin
OriginalGriff30-Dec-09 2:01
mveOriginalGriff30-Dec-09 2:01 
AnswerRe: Invoke a function every time that a function is been added to my event Pin
petercrab30-Dec-09 16:56
petercrab30-Dec-09 16:56 
QuestionThreads, speed up calculations Pin
Renven30-Dec-09 1:01
Renven30-Dec-09 1:01 
AnswerRe: Threads, speed up calculations Pin
Rob Philpott30-Dec-09 1:17
Rob Philpott30-Dec-09 1:17 
GeneralRe: Threads, speed up calculations Pin
Renven30-Dec-09 1:31
Renven30-Dec-09 1: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.