Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        public void TriggerEnd()
        {
            Stop();

            Enabled = false;

            TimeUpEvent?.Invoke(this);
        }
Exemplo n.º 3
0
    // 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();
    }
Exemplo n.º 4
0
 private void OnTimeUpEvent()
 {
     TimeUpEvent?.Invoke(this, System.EventArgs.Empty);
 }
Exemplo n.º 5
0
 protected virtual void OnTimeUpEvent()
 {
     TimeUpEvent?.Invoke(this, EventArgs.Empty);
 }