예제 #1
0
 /// <summary>
 /// Start le pomodoro ou le met en pause
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void StartPomodoro(object sender, RoutedEventArgs e)
 {
     // Check si le timer est lancé
     if (!MonTimer.isStart())
     {
         btnPause.Content = "Pause";
         // On lance un timer
         MonDispatcheTimer = new DispatcherTimer();
         var time = 0;
         try
         {
             time = timeArray[indexTimeArray];
         }
         catch (Exception)
         {
             time = 25;
         }
         MonTimer = new TimerPomo(time, util.TypeTimer.Work);
         if (MonTimer.IsWork())
         {
             // Ouvre une popup pour la séléction du nom
             TimerName tname = new TimerName();
             tname.Owner   = this;
             tname.Closed += new EventHandler(OnClosePomoSaisieName);
             tname.Show();
         }
         MonTimer.HandleChrono(MonDispatcheTimer, lblView, ProgressBarTimeLeft);
     }
     else
     {
         MonTimer.setPause(btnPause);
     }
 }
예제 #2
0
 public MainWindow()
 {
     InitializeComponent();
     MonDispatcheTimer = new System.Windows.Threading.DispatcherTimer();
     MonTimer          = new TimerPomo(25, util.TypeTimer.Work);
     MonTimer.setLabelChrono(lblView);
 }