BypassPropertyChecks suggestion

BypassPropertyChecks suggestion

Old forum URL: forums.lhotka.net/forums/t/9159.aspx


maxal posted on Thursday, July 01, 2010

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.

ajj3085 replied on Thursday, July 01, 2010

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.

RockfordLhotka replied on Friday, July 02, 2010

Yeah, good idea - added to the wish list: http://www.lhotka.net/cslabugs/edit_bug.aspx?id=791

rfcdejong replied on Saturday, July 03, 2010

Nice idea!

Note: There should be something to set the count back to zero, for example when catching an exception..

 

RockfordLhotka replied on Sunday, July 04, 2010

rfcdejong

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