Click here to Skip to main content
16,016,736 members
Home / Discussions / C#
   

C#

 
AnswerRe: Generics? Pin
harold aptroot5-Nov-12 5:59
harold aptroot5-Nov-12 5:59 
AnswerRe: Generics? Pin
Matt T Heffron5-Nov-12 11:29
professionalMatt T Heffron5-Nov-12 11:29 
QuestionMy DataGridView - FirstDisplayedScrollingRowIndex Pin
Paramu19735-Nov-12 5:06
Paramu19735-Nov-12 5:06 
QuestionGetter Pin
C-P-User-35-Nov-12 2:49
C-P-User-35-Nov-12 2:49 
AnswerRe: Getter Pin
J4amieC5-Nov-12 3:01
J4amieC5-Nov-12 3:01 
GeneralRe: Getter Pin
C-P-User-35-Nov-12 4:30
C-P-User-35-Nov-12 4:30 
GeneralRe: Getter Pin
Dave Kreskowiak5-Nov-12 4:43
mveDave Kreskowiak5-Nov-12 4:43 
GeneralRe: Getter Pin
J4amieC5-Nov-12 4:44
J4amieC5-Nov-12 4:44 
in C# getters and setters are just syntactic sugar for get_Propertyname() and set_Propertyname(value) methods.

Think of a customer

public class Customer
{
    private string name;
    public string Name
    {
        get{ return this.name; }
        set{ this.name = value; }
    }
}


Usage
var cust = new Customer();
cust.Name = "Jamie"; // setter invoked
MessageBox.Show(cust.Name); // getter invoked

GeneralRe: Getter Pin
Pete O'Hanlon5-Nov-12 4:47
mvePete O'Hanlon5-Nov-12 4:47 
AnswerRe: Getter Pin
Abhinav S5-Nov-12 5:37
Abhinav S5-Nov-12 5:37 
GeneralRe: Getter Pin
C-P-User-35-Nov-12 7:18
C-P-User-35-Nov-12 7:18 
GeneralRe: Getter Pin
Pete O'Hanlon5-Nov-12 8:01
mvePete O'Hanlon5-Nov-12 8:01 
AnswerRe: Getter Pin
DaveyM695-Nov-12 8:06
professionalDaveyM695-Nov-12 8:06 
GeneralRe: Getter Pin
C-P-User-35-Nov-12 8:29
C-P-User-35-Nov-12 8:29 
GeneralRe: Getter Pin
DaveyM695-Nov-12 8:41
professionalDaveyM695-Nov-12 8:41 
GeneralRe: Getter Pin
Pete O'Hanlon5-Nov-12 8:45
mvePete O'Hanlon5-Nov-12 8:45 
QuestionFORMAT ASSEMBLY Pin
Member 91410335-Nov-12 2:01
Member 91410335-Nov-12 2:01 
AnswerRe: FORMAT ASSEMBLY Pin
Eddy Vluggen5-Nov-12 2:13
professionalEddy Vluggen5-Nov-12 2:13 
GeneralRe: FORMAT ASSEMBLY Pin
Member 91410335-Nov-12 2:23
Member 91410335-Nov-12 2:23 
GeneralRe: FORMAT ASSEMBLY Pin
Eddy Vluggen5-Nov-12 2:27
professionalEddy Vluggen5-Nov-12 2:27 
GeneralRe: FORMAT ASSEMBLY Pin
Member 91410335-Nov-12 2:29
Member 91410335-Nov-12 2:29 
QuestionRe: FORMAT ASSEMBLY Pin
Eddy Vluggen5-Nov-12 2:42
professionalEddy Vluggen5-Nov-12 2:42 
AnswerRe: FORMAT ASSEMBLY Pin
Member 91410335-Nov-12 3:15
Member 91410335-Nov-12 3:15 
GeneralRe: FORMAT ASSEMBLY Pin
Dave Kreskowiak5-Nov-12 3:21
mveDave Kreskowiak5-Nov-12 3:21 
GeneralRe: FORMAT ASSEMBLY Pin
Member 91410335-Nov-12 3:35
Member 91410335-Nov-12 3:35 

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.