Exemplo n.º 1
0
 /// <summary> 
 /// 窗口加载事件 
 /// </summary> 
 /// <param name="sender"></param> 
 /// <param name="e"></param> 
 private void MainWin_Loaded(object sender, RoutedEventArgs e)////////////////////////////////////////
 {
     //设置定时器 
     timer = new DispatcherTimer();
     timer.Interval = new TimeSpan(10000000); //时间间隔为一秒 
     timer.Tick += new EventHandler(timer_Tick);
     //转换成秒数 
     //Int32 hour = Convert.ToInt32(HourArea.Text);
     //Int32 minute = Convert.ToInt32(MinuteArea.Text);
     Int32 second = Convert.ToInt32(SecondArea.Text);
     //处理倒计时的类 
     processCount = new ProcessCount(second);
     CountDown += new CountDownHandler(processCount.ProcessCountDown);
     //开启定时器 
     timer.Start();
 }
Exemplo n.º 2
0
        /// <summary>
        /// 窗口加载事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainWin_Loaded(object sender, RoutedEventArgs e)////////////////////////////////////////
        {
            //设置定时器
            timer          = new DispatcherTimer();
            timer.Interval = new TimeSpan(10000000); //时间间隔为一秒
            timer.Tick    += new EventHandler(timer_Tick);
            //转换成秒数
            //Int32 hour = Convert.ToInt32(HourArea.Text);
            //Int32 minute = Convert.ToInt32(MinuteArea.Text);
            Int32 second = Convert.ToInt32(SecondArea.Text);

            //处理倒计时的类
            processCount = new ProcessCount(second);
            CountDown   += new CountDownHandler(processCount.ProcessCountDown);
            //开启定时器
            timer.Start();
        }