private void Active() { // if less than 30 seconds since mouse was moved last time - define as active var activeSpan = DateTime.Now - LastActivity; if (activeSpan.TotalSeconds < 30) { TimeActive = TimeActive.Add(activeSpan); } LastActivity = DateTime.Now; }
public void Add(double seconds) { TimeActive = TimeActive.Add(TimeSpan.FromSeconds(seconds)); }