So this automatic property is not being used by the other class members?
Here's the deal. In a normal property, you have this:
private int _myIntProp;
public int MyIntProp
{
get { return _myIntProp; }
set { _myIntProp = value; }
}
Now your code can refer to the value that the property represents in one of
two ways:
int x = _myIntProp;
or
int x = this.MyIntProp; // "this." is of course optional
Many people consider it bad programming practice to refer to the backing
variable ( _myIntProp ) directly, because in many properties, code may be
getting executed in the getter, setter, or both, and accessing or changing
the variable directly would bypass this code. In the above example, this is
NOT an issue.
In an attempt to "save you from yourself," these new automatic properties
were created. Now you can NEVER directly access the backing variable because
it's hidden from you. So if you do this:
public int MyIntProp
{ get; set; }
you can ONLY refer to the value with "this.MyIntProp". Get it?