Click here to Skip to main content
15,916,371 members
Home / Discussions / C#
   

C#

 
GeneralRe: Automatically Compiler Generated Unique Constants ? Pin
C-P-User-321-Nov-12 14:52
C-P-User-321-Nov-12 14:52 
GeneralRe: Automatically Compiler Generated Unique Constants ? Pin
C-P-User-321-Nov-12 15:03
C-P-User-321-Nov-12 15:03 
GeneralRe: Automatically Compiler Generated Unique Constants ? Pin
C-P-User-321-Nov-12 15:01
C-P-User-321-Nov-12 15:01 
GeneralRe: Automatically Compiler Generated Unique Constants ? Pin
PIEBALDconsult21-Nov-12 16:27
mvePIEBALDconsult21-Nov-12 16:27 
GeneralRe: Automatically Compiler Generated Unique Constants ? Pin
Eddy Vluggen21-Nov-12 21:08
professionalEddy Vluggen21-Nov-12 21:08 
GeneralRe: Automatically Compiler Generated Unique Constants ? Pin
Richard MacCutchan21-Nov-12 22:01
mveRichard MacCutchan21-Nov-12 22:01 
GeneralRe: Automatically Compiler Generated Unique Constants ? Pin
C-P-User-322-Nov-12 14:22
C-P-User-322-Nov-12 14:22 
GeneralRe: Automatically Compiler Generated Unique Constants ? Pin
Richard MacCutchan22-Nov-12 23:24
mveRichard MacCutchan22-Nov-12 23:24 
GeneralRe: Automatically Compiler Generated Unique Constants ? Pin
BobJanova22-Nov-12 23:29
BobJanova22-Nov-12 23:29 
GeneralRe: Automatically Compiler Generated Unique Constants ? Pin
C-P-User-323-Nov-12 4:43
C-P-User-323-Nov-12 4:43 
QuestionDataGridView doesn't appear on screen Pin
RickSharp21-Nov-12 12:44
RickSharp21-Nov-12 12:44 
AnswerRe: DataGridView doesn't appear on screen Pin
Eddy Vluggen21-Nov-12 13:17
professionalEddy Vluggen21-Nov-12 13:17 
GeneralRe: DataGridView doesn't appear on screen Pin
RickSharp21-Nov-12 13:27
RickSharp21-Nov-12 13:27 
GeneralRe: DataGridView doesn't appear on screen Pin
Eddy Vluggen21-Nov-12 13:42
professionalEddy Vluggen21-Nov-12 13:42 
QuestionTextbox help! Pin
Kurac121-Nov-12 11:18
Kurac121-Nov-12 11:18 
AnswerRe: Textbox help! Pin
Mycroft Holmes21-Nov-12 12:01
professionalMycroft Holmes21-Nov-12 12:01 
QuestionSpecialized List Sorting question Pin
NuclearMan8521-Nov-12 7:12
NuclearMan8521-Nov-12 7:12 
AnswerRe: Specialized List Sorting question Pin
Richard Deeming21-Nov-12 8:03
mveRichard Deeming21-Nov-12 8:03 
AnswerRe: Specialized List Sorting question Pin
SledgeHammer0121-Nov-12 8:06
SledgeHammer0121-Nov-12 8:06 
AnswerRe: Specialized List Sorting question Pin
Richard Deeming21-Nov-12 8:32
mveRichard Deeming21-Nov-12 8:32 
AnswerRe: Specialized List Sorting question Pin
PIEBALDconsult21-Nov-12 8:57
mvePIEBALDconsult21-Nov-12 8:57 
AnswerRe: Specialized List Sorting question Pin
BobJanova21-Nov-12 22:50
BobJanova21-Nov-12 22:50 
QuestionWinForms Class Design Pin
Member 961929521-Nov-12 6:43
Member 961929521-Nov-12 6:43 
AnswerRe: WinForms Class Design Pin
Richard MacCutchan21-Nov-12 7:15
mveRichard MacCutchan21-Nov-12 7:15 
You should implement your StaffName property in your base (not abstract) class, as it will be used by all types. Any common properties or methods should be in the base class, and the child classes only need things that are unique to them. So you would have:
C#
public class Staff
{
    private string staffName;
    public string StaffName
    {
        get
        {
            return staffName;
        }
        set
        {
            staffName = value;
        }
    }
}

public class Professor : Staff
{
    // things unique to Professors
}

public class Lecturer : Staff
{
    // things unique to Lecturers
}

One of these days I'm going to think of a really clever signature.

GeneralRe: WinForms Class Design Pin
Matt U.21-Nov-12 8:16
Matt U.21-Nov-12 8:16 

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.