Click here to Skip to main content
15,913,332 members
Home / Discussions / C#
   

C#

 
SuggestionRe: Inheritance Pin
Sascha Lefèvre19-Jun-15 12:53
professionalSascha Lefèvre19-Jun-15 12:53 
Suggestions:

If this isn't a quickly abstracted example but your actual code then don't include the type name in the name of fields or properties and also not the class name. "PDVString" doesn't convey any useful meaning. If it is a description, name it "Description" or likewise for whatever it is.

And to me it looks like you could just as well make it a base class member. For handhelds it will contain the description (or whatever) for handhelds and else for non-handhelds. Likewise you could replace the TextBoxes "txtPDV" and "txtPDVHH" by a single TextBox "txtDescription" and thus do away with any type distinction:
C#
var pdv1 = isHandheld /* == true */ ? (basePDV)new PDVHH() : (basePDV)new PDV();
                      // ^^^ superfluous because isHandheld already is a boolean

txtCaseID.Text = pdv1.CaseID;
txtDescription.Text = pdv1.Description;

If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

AnswerRe: Inheritance Pin
JammoD8719-Jun-15 21:26
JammoD8719-Jun-15 21:26 
QuestionC# need 2 threads for long execution Pin
dracebus19-Jun-15 8:48
dracebus19-Jun-15 8:48 
AnswerRe: C# need 2 threads for long execution Pin
PIEBALDconsult19-Jun-15 8:59
mvePIEBALDconsult19-Jun-15 8:59 
GeneralRe: C# need 2 threads for long execution Pin
dracebus19-Jun-15 9:02
dracebus19-Jun-15 9:02 
GeneralRe: C# need 2 threads for long execution Pin
PIEBALDconsult19-Jun-15 9:12
mvePIEBALDconsult19-Jun-15 9:12 
GeneralRe: C# need 2 threads for long execution Pin
Dave Kreskowiak19-Jun-15 9:21
mveDave Kreskowiak19-Jun-15 9:21 
GeneralRe: C# need 2 threads for long execution Pin
Philippe Mori19-Jun-15 16:20
Philippe Mori19-Jun-15 16:20 
QuestionTrying to sum several fields into a total field Pin
Norris Chappell18-Jun-15 16:17
Norris Chappell18-Jun-15 16:17 
AnswerRe: Trying to sum several fields into a total field Pin
OriginalGriff18-Jun-15 19:15
mveOriginalGriff18-Jun-15 19:15 
GeneralRe: Trying to sum several fields into a total field Pin
Norris Chappell18-Jun-15 20:26
Norris Chappell18-Jun-15 20:26 
GeneralRe: Trying to sum several fields into a total field Pin
Norris Chappell18-Jun-15 20:31
Norris Chappell18-Jun-15 20:31 
GeneralRe: Trying to sum several fields into a total field Pin
Pete O'Hanlon18-Jun-15 22:39
mvePete O'Hanlon18-Jun-15 22:39 
GeneralRe: Trying to sum several fields into a total field Pin
Norris Chappell19-Jun-15 4:44
Norris Chappell19-Jun-15 4:44 
GeneralRe: Trying to sum several fields into a total field Pin
Richard MacCutchan19-Jun-15 7:02
mveRichard MacCutchan19-Jun-15 7:02 
GeneralRe: Trying to sum several fields into a total field Pin
Norris Chappell19-Jun-15 7:23
Norris Chappell19-Jun-15 7:23 
GeneralRe: Trying to sum several fields into a total field Pin
Norris Chappell19-Jun-15 5:35
Norris Chappell19-Jun-15 5:35 
GeneralRe: Trying to sum several fields into a total field Pin
Norris Chappell19-Jun-15 9:30
Norris Chappell19-Jun-15 9:30 
AnswerRe: Trying to sum several fields into a total field Pin
Agent__00718-Jun-15 20:30
professionalAgent__00718-Jun-15 20:30 
GeneralRe: Trying to sum several fields into a total field Pin
Norris Chappell18-Jun-15 20:36
Norris Chappell18-Jun-15 20:36 
GeneralRe: Trying to sum several fields into a total field Pin
Richard MacCutchan18-Jun-15 22:05
mveRichard MacCutchan18-Jun-15 22:05 
GeneralRe: Trying to sum several fields into a total field Pin
Agent__00718-Jun-15 23:23
professionalAgent__00718-Jun-15 23:23 
GeneralRe: Trying to sum several fields into a total field Pin
Norris Chappell19-Jun-15 3:25
Norris Chappell19-Jun-15 3:25 
QuestionFind 2 Dates A DateTime Falls between From Dictionary Pin
Kevin Marois18-Jun-15 6:38
professionalKevin Marois18-Jun-15 6:38 
AnswerRe: Find 2 Dates A DateTime Falls between From Dictionary Pin
Sascha Lefèvre18-Jun-15 6:56
professionalSascha Lefèvre18-Jun-15 6:56 

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.