function updateAutoScrollTimer(dp,timerShouldRun)
% Manage auto-scroll timer state.
% If timerShouldRun=true, the timer is started if currently stopped.
% Similarly, if timerShouldRun=false, the timer is stopped if running

%   Copyright 2010 The MathWorks, Inc.

hTimer = dp.hAutoScrollTimer;
if timerShouldRun
    if strcmpi(hTimer.Running,'off')
        start(hTimer);
    end
else
    if ~strcmpi(hTimer.Running,'off')
        stop(hTimer);
    end
end
