public void timeCount(PdetailInfo pdetailInfo) { CheckForIllegalCrossThreadCalls = false; UserLogEvent?.Invoke(); TimeSpan ds = pdetailInfo.StartTime - DateTime.Now - (pdetailInfo.Webtime - pdetailInfo.Systime); bool isRelogin = false; ListViewItem item = pid_listView.FindItemWithText(pdetailInfo.ID); while (ds.TotalSeconds >= 0) { ds = pdetailInfo.StartTime - DateTime.Now - (pdetailInfo.Webtime - pdetailInfo.Systime); double dH = ds.Hours; double dM = ds.Minutes; double dS = ds.Seconds; item.SubItems[1].Text = dH.ToString() + "时" + dM.ToString() + "分" + dS.ToString() + "秒"; if (ds.TotalSeconds < 60 && isRelogin == false) { UserLogEvent?.Invoke(); isRelogin = true; } Thread.CurrentThread.Join(1000); } TimeUpEvent?.Invoke(pdetailInfo.ID);// 发布信号 // CheckForIllegalCrossThreadCalls = true; }
public void TriggerEnd() { Stop(); Enabled = false; TimeUpEvent?.Invoke(this); }
// Use this for initialization void Start() { timerLabel = this.GetComponent <Text> (); scoreController = GameObject.Find("score").GetComponent <ScoreController> (); readyEvent = GameObject.Find("ready_event").GetComponent <ReadyEvent> (); timeupEvent = GameObject.Find("time_up_event").GetComponent <TimeUpEvent> (); highScoreButton = GameObject.Find("highscore_button"); restartButton = GameObject.Find("restart_button"); menuButton = GameObject.Find("menu_button"); Restart(); }
private void OnTimeUpEvent() { TimeUpEvent?.Invoke(this, System.EventArgs.Empty); }
protected virtual void OnTimeUpEvent() { TimeUpEvent?.Invoke(this, EventArgs.Empty); }