Beispiel #1
0
        private void startTimer(TimeSpan duration, String label)
        {
            if (layoutPanel.InvokeRequired)
            {
                startTimerCallback d = new startTimerCallback(startTimer);
                this.Invoke(d, new object[] { duration, label });
            }
            else
            {
                CountDownTimer countDown = new CountDownTimer();

                layoutPanel.Controls.Add(countDown);
                countDown.Duration = duration;
                countDown.Label    = label;
                countDown.Expired += new EventHandler(countDown_Expired);
                countDown.Start();
            }
        }
Beispiel #2
0
        private void startTimer(TimeSpan duration, String label)
        {
            if (layoutPanel.InvokeRequired)
            {
                startTimerCallback d = new startTimerCallback(startTimer);
                this.Invoke(d, new object[] { duration, label });
            }
            else
            {
                CountDownTimer countDown = new CountDownTimer();

                layoutPanel.Controls.Add(countDown);
                countDown.Duration = duration;
                countDown.Label = label;
                countDown.Expired += new EventHandler(countDown_Expired);
                countDown.Start();
            }
        }