Hi
I have written a class with a private member & public member with accessors
thus
public class Wierd
{
private int _MyInt = 0;
private bool _MyIntGot = false;
public int MyInt
{
get
{
_MyIntGot = true;
return _MyInt;
}
set
{
_MyInt = value;
_MyIntGot = true;
}
}
public Wierd()
{
}
}
then on a windows form i have
private void button1_Click(object sender, System.EventArgs e)
{
Wierd _MyWierd = new Wierd();
string g = "g";
g = "hh"; // do something
g = "kk"; // do something
int i = _MyWierd.MyInt;
}
In the debugger I can see that _MyWierd._MyIntGot becomes true before the line
int i = _MyWierd.MyInt;
The get accessor for _MyWierd.MyInt seems to be being called, though no
breakpoint is being hit there.
Can anyone tell me what is going on here?
Thanks in advance
Steve