Ejemplo n.º 1
0
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item    = sender as ToolStripMenuItem;
            ContextMenuStrip  context = item.Owner as ContextMenuStrip;
            CountDownTimer    timer   = context.SourceControl as CountDownTimer;

            timer.Stop();
            timer.Dispose();
        }
Ejemplo n.º 2
0
        void countDown_Expired(object sender, EventArgs e)
        {
            CountDownTimer countDown = sender as CountDownTimer;

            countDown.Click += new EventHandler(countDown_Click);

            trayIcon.ShowBalloonTip(5000, "Wurmtimer", String.Format("Countdown {0} expired", countDown.Label), ToolTipIcon.Info);
            FlashWindow();
        }
Ejemplo n.º 3
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();
            }
        }
Ejemplo n.º 4
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();
            }
        }