c# - How can I to check a property will be renewed or its value will be changed -


how can check property renewed or value changed.

public myclass {    get{}     set       {           // find if programmer set a=new myclass();        } } 

it's not clear want exactly, maybe this:

myclass _a; public myclass {     { return _a; }     set     {         // find if programmer set a=new myclass();         if (value != _a)         {             // different value         }     } } 

for more complex scenario follow suggestion of raphaƫl althaus , take @ inotifypropertychanged.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -