Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. class MyBase
  2. {
  3. MyBase()
  4. {
  5. Record();
  6. }
  7.  
  8. void Record()
  9. {
  10. /// this line is able to handle every object
  11. Recorder.Process(this);
  12. }
  13. }
  14.  
  15. class DerivedA : MyBase
  16. {
  17. public int SpecialPropertyOfA { get; set; }
  18. DerivedA(int specialPropertyOfA)
  19. {
  20. SpecialPropertyOfA = specialPropertyOfA;
  21. }
  22. }
  23.  
  24. class DerivedB : MyBase
  25. {
  26. public string SpecialPropertyOfB { get; set; }
  27. DerivedA(string specialPropertyOfB)
  28. {
  29. SpecialPropertyOfB = specialPropertyOfB;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement