No, this is not possible * to receive notification of changes to the value of a variable.
You can achieve almost what you want by making the value an attribute of a certain class and events of fire when you change, as you wish.
*) if your code is a debugger for the process, you can force the CPU to notify you of changes - see data breakpoints in Visual Studio. This will require at least some native code and is more difficult to implement correctly for managed code because of the ability to move objects in memory using GC.
Alexei Levenkov
source share