If the set property goes to infinite loop, then there is some problem with accessor and mutator.
The following example is a good (rather bad) for recursive looping of the properties
public playerType PlayerType
{
get { return PlayerType; }
set
{
PlayerType = value;
}
}
In order to correct it, declare a private variable and get/set that variable.
private playerType _PlayerType;
public playerType PlayerType
{
get { return _PlayerType; }
set
{
_PlayerType = value;
}
}
No comments:
Post a Comment