class Bar
{
private byte[] dg;
Bar(byte[] datagram)
{
dg = datagram;
}
int Foo
{
get { return BitConverter.ToInt16(dg, 8); }
}
}
When are properties evaluated? At the time Foo is accessed? The debugger evaluating all properties is scaring me.
Yes, a property is just syntactic sugar for the call to
getaccessor method. Every time property is read, the method executes. And yes, this does include the debugger (which is why if your property gettors have side effects, debugging can actually affect the way your program works).