C
Curious
Hi,
I have a C# class that contains a property defined as follows:
public bool bRunTwice
{
get { return bRunTwice; }
set { bRunTwice = value; }
}
Then I have a method in the same class that uses the property as
below:
bRunTwice = true;
This causes an infinite loop. However, if I replaced the property
block to a public member (which is not the best way):
public bool bRunTwice;
Everything works. How come using property causes trouble?
I have a C# class that contains a property defined as follows:
public bool bRunTwice
{
get { return bRunTwice; }
set { bRunTwice = value; }
}
Then I have a method in the same class that uses the property as
below:
bRunTwice = true;
This causes an infinite loop. However, if I replaced the property
block to a public member (which is not the best way):
public bool bRunTwice;
Everything works. How come using property causes trouble?