Hello,
This is suggestion.
In current implementation BypassPropertyChecks uses private boolean field _bypassPropertyChecks. If it was integer instead of boolean, it could be incremented/decremented instead of just setting to True and False, and then BypassPropertyChecks could be used recursevly, which is not working now.
I think this is a good idea as well; I've had a few cases where I had to make sure I wasn't calling this multiple times.
Yeah, good idea - added to the wish list: http://www.lhotka.net/cslabugs/edit_bug.aspx?id=791
Nice idea!
Note: There should be something to set the count back to zero, for example when catching an exception..
Note: There should be something to set the count back to zero, for example when catching an exception..
The using block structure and IDisposable will make this essentially automatic. As long as Dispose() decrements the count it will work because the using block will call Dispose() even if an exception occurs.
Copyright (c) Marimer LLC