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 get accessor 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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With