Guest User

Untitled

a guest
Jul 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. //original:
  2. [Required]
  3. public string SomeProperty
  4. {
  5. get { return someProperty; }
  6. set
  7. {
  8. someProperty = value;
  9. if (isInSomeMode) return;
  10. //do some stuff
  11. }
  12. }
  13.  
  14. //weaved:
  15. [Required]
  16. public string SomeProperty
  17. {
  18. get
  19. {
  20. return this.someProperty;
  21. }
  22. set
  23. {
  24. if (!object.Equals(this.someProperty, value))
  25. {
  26. this.someProperty= value;
  27. if (!this.isInSomeMode)
  28. {
  29. //do some stuff
  30. base.NotifyOfPropertyChange("SomeProperty");
  31. }
  32. }
  33. }
  34. }
  35.  
  36. //what i would expect:
  37.  
  38. [Required]
  39. public string SomeProperty
  40. {
  41. get
  42. {
  43. return this.someProperty;
  44. }
  45. set
  46. {
  47. if (!object.Equals(this.someProperty, value))
  48. {
  49. this.someProperty= value;
  50. if (!this.isInSomeMode)
  51. {
  52. //do some stuff
  53. }
  54. base.NotifyOfPropertyChange("SomeProperty");
  55. }
  56. }
  57. }
  58.  
  59.  
  60. //I expect the notification every time this.someProperty != value (don't care other code)
Add Comment
Please, Sign In to add comment