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

C#

 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
#realJSOP30-Dec-09 7:08
mve#realJSOP30-Dec-09 7:08 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 8:29
Alex Manolescu30-Dec-09 8:29 
AnswerRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Luc Pattyn30-Dec-09 6:49
sitebuilderLuc Pattyn30-Dec-09 6:49 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 7:00
Alex Manolescu30-Dec-09 7:00 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Luc Pattyn30-Dec-09 7:30
sitebuilderLuc Pattyn30-Dec-09 7:30 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 8:25
Alex Manolescu30-Dec-09 8:25 
AnswerRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
petercrab30-Dec-09 17:59
petercrab30-Dec-09 17:59 
QuestionAbstracts: can I do better than this? Pin
MollyTheCoder30-Dec-09 4:45
MollyTheCoder30-Dec-09 4:45 
I know I'm missing something simple. I have a base class, Device, and a bunch of derived classes Dev1, Dev2... Depending on the type of device active at the moment, I have an abstract method for each derived type. Deciding which to use leads me to:

C#
if (SelectedDevice.GetType() == typeof(Dev1))
{
SetDevice((Dev1)SelectedDevice);
}
else if (SelectedDevice.GetType() == typeof(Dev2))
{
SetDevice((Dev2)SelectedDevice);
}    
else if ...


It works, but it just feels ugly.

Molly
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 
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 

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.