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

C#

 
Question[C#] - Obtaining no: of files & file sizes Pin
aravinda77716-Aug-07 8:40
aravinda77716-Aug-07 8:40 
AnswerRe: [C#] - Obtaining no: of files & file sizes Pin
Luc Pattyn16-Aug-07 8:45
sitebuilderLuc Pattyn16-Aug-07 8:45 
Question[SOLVED] Castle ActiveRecord and abstract classes... Pin
Xiol3216-Aug-07 7:19
Xiol3216-Aug-07 7:19 
AnswerRe: Castle ActiveRecord and abstract classes... Pin
Not Active16-Aug-07 9:19
mentorNot Active16-Aug-07 9:19 
AnswerRe: Castle ActiveRecord and abstract classes... Pin
Mark Churchill16-Aug-07 15:46
Mark Churchill16-Aug-07 15:46 
GeneralRe: Castle ActiveRecord and abstract classes... Pin
Xiol3216-Aug-07 23:08
Xiol3216-Aug-07 23:08 
General[SOLVED] Re: Castle ActiveRecord and abstract classes... Pin
Xiol3216-Aug-07 23:58
Xiol3216-Aug-07 23:58 
QuestionDe-smellifying some code... Pin
martin_hughes16-Aug-07 6:56
martin_hughes16-Aug-07 6:56 
Hey all,

I've been given some fairly whiffy code to update, which I'm going to port over to C#. The port is going very well, but I have an architectural-type question which I hope you guys can help with.

The original developer was clearly a fan of the VB's select-case statement; the app isn't very big, but so far I've found at least 50 seperate instances of this flow control structure (some of which are clearly copied and pasted). Whilst I can quite easily refactor some of the concepts into objects, there is one area I'm not to sure about.

One part of the program reads data in from a file, and depending on the value read in, decides on a course of action. The decision is made by a slect case statement, which to my mind adds fragility to the application as it's probable that more value/decision pairs will need to be made. (Actually, this must have happened to the original developer on seperate occasions, as there are over 70 cases which the comments suggest were added over time!)

Given this, are there any recommended patterns I could look to implement instead of replicating the switch case in my code?


"It was the day before today.... I remember it like it was yesterday."

-Moleman


AnswerRe: De-smellifying some code... Pin
MidwestLimey16-Aug-07 7:24
professionalMidwestLimey16-Aug-07 7:24 
GeneralRe: De-smellifying some code... Pin
martin_hughes16-Aug-07 12:12
martin_hughes16-Aug-07 12:12 
GeneralRe: De-smellifying some code... Pin
Luc Pattyn16-Aug-07 13:03
sitebuilderLuc Pattyn16-Aug-07 13:03 
GeneralRe: De-smellifying some code... Pin
martin_hughes17-Aug-07 6:50
martin_hughes17-Aug-07 6:50 
GeneralRe: De-smellifying some code... Pin
MidwestLimey16-Aug-07 17:20
professionalMidwestLimey16-Aug-07 17:20 
AnswerRe: De-smellifying some code... Pin
PhilDanger16-Aug-07 8:15
PhilDanger16-Aug-07 8:15 
AnswerRe: De-smellifying some code... Pin
Leslie Sanford16-Aug-07 12:35
Leslie Sanford16-Aug-07 12:35 
Questionanonymous method runs "too many times" Pin
gericooper16-Aug-07 5:53
gericooper16-Aug-07 5:53 
AnswerRe: anonymous method runs "too many times" [modified] Pin
Luc Pattyn16-Aug-07 6:45
sitebuilderLuc Pattyn16-Aug-07 6:45 
GeneralRe: anonymous method runs "too many times" Pin
gericooper16-Aug-07 20:26
gericooper16-Aug-07 20:26 
Questionlayers (?) Pin
tim_gunning16-Aug-07 5:52
tim_gunning16-Aug-07 5:52 
AnswerRe: layers (?) Pin
Mark Churchill16-Aug-07 15:54
Mark Churchill16-Aug-07 15:54 
QuestionSelect Method of DataSet - pls help Pin
meeram39516-Aug-07 5:48
meeram39516-Aug-07 5:48 
AnswerRe: Select Method of DataSet - pls help Pin
Giorgi Dalakishvili16-Aug-07 6:02
mentorGiorgi Dalakishvili16-Aug-07 6:02 
AnswerRe: Select Method of DataSet - pls help Pin
kboyette16-Aug-07 10:57
kboyette16-Aug-07 10:57 
QuestionWindows Mobile Applications Pin
Harkamal Singh16-Aug-07 4:57
Harkamal Singh16-Aug-07 4:57 
AnswerRe: Windows Mobile Applications Pin
Not Active16-Aug-07 9:14
mentorNot Active16-Aug-07 9:14 

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.