Last active
December 31, 2015 15:19
-
-
Save maxclaus/8005735 to your computer and use it in GitHub Desktop.
Example of Principle Tell don't Ask
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class Screen | |
{ | |
Form mainForm = ... | |
private void Screen_Loaded(object sender, ControlLoadedEventArgs e) | |
{ | |
if(mainForm.InputControls != null && mainForm.InputControls.Contains("Id")) | |
mainForm.InputControls["Id"].Editable = isEditable; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class Screen | |
{ | |
Form mainForm = ... | |
private void Screen_Loaded(object sender, ControlLoadedEventArgs e) | |
{ | |
mainForm.SetControlEditable("Id"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment