Example #1
0
        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;
        }
Example #2
0
 public void Add(double seconds)
 {
     TimeActive = TimeActive.Add(TimeSpan.FromSeconds(seconds));
 }