Based on the code in Rev 5 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.
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.
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.
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.