Guest User

Untitled

a guest
Jun 25th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. class Base
  2. {
  3. protected Boolean Flag { get; set; }
  4.  
  5. public void Foo()
  6. {
  7. if (this.Flag)
  8. {
  9. // logic here
  10. }
  11. }
  12. }
  13.  
  14. class Child : Base
  15. {
  16. public Child()
  17. {
  18. // you can set Flag anywhere you wish
  19. this.Flag = true;
  20. }
  21. }
Add Comment
Please, Sign In to add comment