Click here to Skip to main content
16,012,116 members
Home / Discussions / C#
   

C#

 
QuestionIs MSHTML support RTF ? Pin
dreamwinter12-Jun-06 18:51
dreamwinter12-Jun-06 18:51 
QuestionCombo box in DataGridView Pin
perryf0012-Jun-06 18:38
perryf0012-Jun-06 18:38 
QuestionGenerics and Remoting Pin
morgan.bell12-Jun-06 16:56
morgan.bell12-Jun-06 16:56 
AnswerRe: Generics and Remoting Pin
Judah Gabriel Himango12-Jun-06 17:18
sponsorJudah Gabriel Himango12-Jun-06 17:18 
GeneralRe: Generics and Remoting Pin
morgan.bell12-Jun-06 17:53
morgan.bell12-Jun-06 17:53 
GeneralRe: Generics and Remoting Pin
morgan.bell13-Jun-06 8:48
morgan.bell13-Jun-06 8:48 
QuestionUsing the Data Source Wizard Pin
Richard Andrew x6412-Jun-06 14:58
professionalRichard Andrew x6412-Jun-06 14:58 
QuestionClass/Application design question Pin
therealmccoy12-Jun-06 14:14
therealmccoy12-Jun-06 14:14 
Background:

I need to read in 3 text files. Each file has it's own format. I decided to code a class for each type. Each class impliments some common methods:

getItem()
getDescription(item)
getCount()

In addition each class contains some items that are more specific to the data in that file. I originally had specified the name of the file to be read in the constructor. The constructor would then load the file (and it's associated data) into arrays then close the file. The instance would look like this...

fileReader1 fr1 = new fileReader1(sFileName);

It was then requested that I validate my input files. This is where my question lies..

What is the best approach for this functionality? Bear in mind I need to not process anything if the file is not valid. I am currently working on a 3 tier design (GUI, Logic, Data). The readers are called from the Logic layer. I have mulled the following:

#1 Move the ability to read the file from the constructor to a public method. Code a new method called 'validated()' that would return TRUE if the file was valid and then call the read method (this would be done from the Logic layer) if validated returns TRUE

#2 Continute to read in the file via the constructor, but only read the file if it is valid (via private validate method). If the file is not valid fire a 'not valid event' and catch it in my GUI.

#3 Create a seperate class called 'Validator' that I pass in the file to validate and the type. If this returns TRUE then continue, otherwise dont'

#4 Let the constructor validate the file. Set a bool variable in my reader class and expose it as a public property. If file is valid set variable to TRUE and call public read method.

I am interested in the best way, the 'professional' way to impliment this. Thanks in advance for your thoughts/comments.




www.lovethosetrains.com
QuestionCould not find installable ISAM Pin
kjosh12-Jun-06 13:45
kjosh12-Jun-06 13:45 
AnswerRe: Could not find installable ISAM Pin
Christian Wulff12-Jun-06 23:59
Christian Wulff12-Jun-06 23:59 
GeneralRe: Could not find installable ISAM Pin
kjosh13-Jun-06 3:40
kjosh13-Jun-06 3:40 
QuestionProblem to Run App from Byte . Pin
hdv21212-Jun-06 13:35
hdv21212-Jun-06 13:35 
QuestionCommandline arguments with apostrophes? [modified] Pin
FocusedWolf12-Jun-06 12:24
FocusedWolf12-Jun-06 12:24 
GeneralRe: Commandline arguments with apostrophes? Pin
Office Lineman12-Jun-06 12:39
Office Lineman12-Jun-06 12:39 
GeneralRe: Commandline arguments with apostrophes? Pin
FocusedWolf12-Jun-06 13:45
FocusedWolf12-Jun-06 13:45 
QuestionRemovable Disk Icons Pin
Robert M Greene12-Jun-06 11:28
Robert M Greene12-Jun-06 11:28 
QuestionHow to call web service without stalling the app? Pin
sergestusxx12-Jun-06 11:23
sergestusxx12-Jun-06 11:23 
AnswerRe: How to call web service without stalling the app? Pin
Nougat H.12-Jun-06 11:48
Nougat H.12-Jun-06 11:48 
GeneralRe: How to call web service without stalling the app? Pin
sergestusxx12-Jun-06 12:30
sergestusxx12-Jun-06 12:30 
QuestionVC# Skinning Pin
Hengy12-Jun-06 11:08
Hengy12-Jun-06 11:08 
QuestionDeleting a stream\file content. Pin
NaNg1524112-Jun-06 10:32
NaNg1524112-Jun-06 10:32 
AnswerRe: Deleting a stream\file content. Pin
Nougat H.12-Jun-06 12:08
Nougat H.12-Jun-06 12:08 
GeneralRe: Deleting a stream\file content. Pin
NaNg1524112-Jun-06 21:46
NaNg1524112-Jun-06 21:46 
QuestionDundas Diagram connection problems Pin
Nougat H.12-Jun-06 9:44
Nougat H.12-Jun-06 9:44 
AnswerRe: Dundas Diagram connection problems Pin
Nish Nishant12-Jun-06 10:07
sitebuilderNish Nishant12-Jun-06 10:07 

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.