private void leave_timer_Tick(object sender, EventArgs e) { if (IsUserLeave()) { //用户离开了电脑 OnLeave(); if (config.options.General.Data) { //持久化统计数据 statistic.Save(); Debug.WriteLine("持久化统计数据"); } } else { //记录数据 if (config.options.General.Data) { //数据统计 statistic.Update(StatisticType.WorkingTime, 5); Debug.WriteLine("记录用眼时长 +5"); } } SaveCursorPos(); }
private void useeye_timer_Tick(object sender, EventArgs e) { Debug.WriteLine("统计用眼时长"); //更新用眼时长 statistic.StatisticUseEyeData(); //数据持久化 statistic.Save(); }
private void StatisticData() { if (config.options.General.Data) { //更新用眼时长 statistic.StatisticUseEyeData(); //数据持久化 statistic.Save(); } }