/// <summary> /// Event handler for the current games time notifier. /// </summary> /// <param name="sender">Sender of the event</param> /// <param name="e">Event arguments</param> private void BlackClockEventHandler(object sender, ClockEventArgs e) { if (BlackClockNotifier != null) { BlackClockNotifier(this, e); } if (e.TimeOut) { HandleChangedGameState(null, false, true); } }
/// <summary> /// Event handler for the current games time notifier. /// </summary> /// <param name="sender">Sender of the event</param> /// <param name="e">Event arguments</param> private void WhiteClockEventHandler(object sender, ClockEventArgs e) { if (WhiteClockNotifier != null) WhiteClockNotifier(this, e); if (e.TimeOut) HandleChangedGameState(null, false, true); }
private void HandleWhiteTimeEvent(object sender, ClockEventArgs e) { string time; if (e.Time.Milliseconds <= 0 || e.ClockType == ClockType.None) { time = e.Time.ToString(); } else { TimeSpan timeSpan = new TimeSpan(e.Time.Hours, e.Time.Minutes, e.Time.Seconds + 1); time = timeSpan.ToString(); } if (time.Contains(".")) time = time.Substring(0, time.IndexOf('.')); m_whiteTimeGraphic.Clear(Color.White); m_whiteTimeGraphic.DrawString(time, m_panelFont, m_blackBrush, (time[0] == '-') ? -3 : 4, 1); pictureWhiteTime.Refresh(); }