private void Timer_tick(object sender, EventArgs e) { seconds = seconds - 1; if (seconds == -1) { minutes = minutes - 1; seconds = 59; } if (minutes == -1) { hours = hours - 1; minutes = 59; } if (hours == 0 && minutes == 0 && seconds == 0) { DTimer.Stop(); NotificationBalloonTips.TimerPopUp(); IsDone = true; } //Dispatcher.Invoke(() => //{ string hh = Convert.ToString(hours); string mm = Convert.ToString(minutes); string ss = Convert.ToString(seconds); main.TimerLabel.Content = hh; main.TimerLabelMM.Content = mm; main.TimerLabelSS.Content = ss; // }); if (!IsDone) { ActivateCounterMeasures(); } }
private void DTimer_Tick(object sender, EventArgs e) { try { if (frameScore >= Global.GameScore) { Score_Result = "Score: " + Global.GameScore; frameScore = Global.GameScore; bScore = true; } else { frameScore += 1; Score_Result = "Score: " + frameScore; } if (frameTime >= Global.GameTime) { Time_Result = "Time: " + Global.GameTime; frameTime = Global.GameTime; bTime = true; } else { frameTime += 1; Time_Result = "Time: " + frameTime; } if (bScore && bTime) { BG_PlayerScore.Stop(); BG_Player.Play(); DTimer.Stop(); } } catch { } }