C.5. Naming C# properties

If you choose to use the same name for a public or protected property which 'represents' a private field in a C# class, they should be differentiated by capitalization. The public/protected property name should use Pascal casing, while the private field should use camel casing. Here is an example:

 1:  private string name; // private field name
 2:
 3:  public string Name{ // property Name
 4:    get{
 5:      return name;
 6:    }
 7:    set {
 8:      name = value;
 9:    }
10:  }

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.93.86