Skip to main content
Code Review

Return to Revisions

2 of 2
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/

Based on the code in Rev 5 of the question...

private void tryEnableCRUD(bool tryEnable=true)
{
 tsbDelete.Enabled = tsbReplace.Enabled = tsbUpload.Enabled =
 (_securityLevel < 3) && tryEnable;
}

The first line emphasizes that all three variables will be assigned the same value. The second line emphasizes that that value will be true only when _securityLevel is less than 3 and tryEnable is true. The fact that the resulting function is compact is a bonus.

200_success
  • 145.6k
  • 22
  • 190
  • 479
default

AltStyle によって変換されたページ (->オリジナル) /