Make the variable a property (in a class).
In that property's setter, record whether the variable is increasing or decreasing each time it is set.
For example:
class Class1
{
private int _counter;
private int _counterDirection;
public int Counter
{
get { return _counter; }
set
{
if (value > _counter)
{
_counterDirection = 1;
}
else if (value < _counter)
{
_counterDirection = -1;
}
else
{
_counterDirection = 0;
}
_counter = value;
}
}
public int CounterDirection()
{
return _counterDirection;
}
}