コード例 #1
0
 private void Delete_Last_Ballon(object sender, RoutedEventArgs e)
 {
     if (IsThereAnyRunningBallon())
     {
         MyThread lastBallon = listRunningThreads.FindLast(mt => MyThread.IsBallonThread(mt));
         if (lastBallon != null)
         {
             nbBallons--;
             Thread lbt = listThreads.FindLast(t => t.ManagedThreadId == lastBallon.Id);
             lbt.Abort();
             listThreads.Remove(lbt);
             listRunningThreads.Remove(lastBallon);
             UpdateListBox();
         }
     }
     else
     {
         ShowWarningDialog("ballon");
     }
 }
コード例 #2
0
 private void Delete_Last_Premier(object sender, RoutedEventArgs e)
 {
     if (IsThereAnyRunningPremier())
     {
         MyThread lastPremier = listRunningThreads.FindLast(mt => MyThread.IsPremierThread(mt));
         if (lastPremier != null)
         {
             nbPremiers--;
             Thread lpt = listThreads.FindLast(t => t.ManagedThreadId == lastPremier.Id);
             lpt.Abort();
             listThreads.Remove(lpt);
             listRunningThreads.Remove(lastPremier);
             UpdateListBox();
         }
     }
     else
     {
         ShowWarningDialog("premier");
     }
 }
コード例 #3
0
 public static bool IsPremierThread(MyThread mt)
 {
     return(mt.Type == "premier");
 }
コード例 #4
0
 public static bool IsBallonThread(MyThread mt)
 {
     return(mt.Type == "ballon");
 }