示例#1
0
 private void UpdateStatus(StatusCheckData status)
 {
     status.DidWorkOnce          = true;
     status.IsWorking            = true;
     status.LastWorkingTimestamp = DateTime.Now;
     OnStatusChanged?.Invoke();
 }
示例#2
0
        public StatusChecker()
        {
            InterceptorStatus = new StatusCheckData(TimeSpan.FromSeconds(1));
            KeyboardStatus    = new StatusCheckData();
            MouseStatus       = new StatusCheckData();

            StatusList = new List <StatusCheckData>()
            {
                InterceptorStatus, KeyboardStatus, MouseStatus
            };

            m_AutoEvent = new AutoResetEvent(false);
            m_Timer     = new Timer(CheckStatus, m_AutoEvent, Timeout.Infinite, Timeout.Infinite);
        }