Created
January 11, 2011 14:28
-
-
Save jfromaniello/774466 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//original: | |
[Required] | |
public string SomeProperty | |
{ | |
get { return someProperty; } | |
set | |
{ | |
someProperty = value; | |
if (isInSomeMode) return; | |
//do some stuff | |
} | |
} | |
//weaved: | |
[Required] | |
public string SomeProperty | |
{ | |
get | |
{ | |
return this.someProperty; | |
} | |
set | |
{ | |
if (!object.Equals(this.someProperty, value)) | |
{ | |
this.someProperty= value; | |
if (!this.isInSomeMode) | |
{ | |
//do some stuff | |
base.NotifyOfPropertyChange("SomeProperty"); | |
} | |
} | |
} | |
} | |
//what i would expect: | |
[Required] | |
public string SomeProperty | |
{ | |
get | |
{ | |
return this.someProperty; | |
} | |
set | |
{ | |
if (!object.Equals(this.someProperty, value)) | |
{ | |
this.someProperty= value; | |
if (!this.isInSomeMode) | |
{ | |
//do some stuff | |
} | |
base.NotifyOfPropertyChange("SomeProperty"); | |
} | |
} | |
} | |
//I expect the notification every time this.someProperty != value (don't care other code) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment