private void Button_Click(object sender, RoutedEventArgs e)
        {
            if ((temp.Text != null) && (taille.Text != null))
            {
                int ind, f = 0;
                try
                {
                    f = Convert.ToInt32(taille.Text);
                    if (f > mem.capacite)
                    {
                        throw new Exception();
                    }
                    if (f < 0)
                    {
                        throw new FormatException();
                    }
                }
                catch (FormatException)
                {
                    Error.Text = "Taille Devrait etre un entier positive";

                    ColorAnimation myColorAnimation = new ColorAnimation(Colors.Red, Color.FromRgb(241, 239, 239), TimeSpan.FromMilliseconds(4000));
                    Error.Foreground.BeginAnimation(SolidColorBrush.ColorProperty, myColorAnimation);
                    return;
                }
                catch (Exception)
                {
                    Error.Text = "Taille plus grand que la capacité max de la mémoire";

                    ColorAnimation myColorAnimation = new ColorAnimation(Colors.Red, Color.FromRgb(241, 239, 239), TimeSpan.FromMilliseconds(4000));
                    Error.Foreground.BeginAnimation(SolidColorBrush.ColorProperty, myColorAnimation);
                    return;
                }
                finally
                {
                    ColorAnimation myColorAnimation = new ColorAnimation(Color.FromRgb(0, 255, 184), TimeSpan.FromMilliseconds(4000));
                }

                if (f < mem.capacite)
                {
                    /*taillebar.Fill = new SolidColorBrush(Color.FromRgb(10, 201, 1));
                     *                  tempbar.Fill = new SolidColorBrush(Color.FromRgb(10, 201, 1));*/
                    try
                    {
                        if ((Convert.ToInt32(temp.Text)) < 0)
                        {
                            throw new FormatException();
                        }
                        pro.ajout_process(name.Text, Convert.ToInt32(taille.Text), Convert.ToInt32(temp.Text) + 1);
                    }
                    catch (ArgumentNullException)
                    {
                        Error.Text = "ArgumentNullException";

                        return;
                    }
                    catch (ArithmeticException)
                    {
                        Error.Text = "Invalide type of taille or temp";
                        return;
                    }
                    catch (FormatException)
                    {
                        Error.Text = "Temp devrait etre un entier positive";
                        ColorAnimation myColorAnimation = new ColorAnimation(Colors.Red, Colors.Gray, TimeSpan.FromMilliseconds(2000));
                        Error.Foreground.BeginAnimation(SolidColorBrush.ColorProperty, myColorAnimation);
                        return;
                    }



                    if (T != 0)
                    {
                        Derl.Add("");
                        switch (P)
                        {
                        default:
                            ind = mem.firts_fit(Convert.ToInt32(taille.Text));
                            break;

                        case 0:
                            ind = mem.firts_fit(Convert.ToInt32(taille.Text));
                            break;

                        case 1:
                            ind = mem.best_fit(Convert.ToInt32(taille.Text));
                            break;

                        case 2:
                            ind = mem.worst_fit(Convert.ToInt32(taille.Text));
                            break;

                        case 3:
                            ind = mem.Next_fit(Convert.ToInt32(taille.Text));
                            break;
                        }

                        if (ind >= 0)
                        {
                            Derl[T - 1] += ">>>> le processus <" + name.Text + ">  est ajouter a lemplacement   <" + ind + "> Avec l'algorihtme de:  <<" + Enum.GetValues(AlgoR).GetValue(P) + ">>\n\n";
                            pro.corriger_prt(ind, mem.allocation_process(ind, pro.fifo.Count + pro.en_cours.Count, Convert.ToInt32(taille.Text))); pro.execute_process(pro.fifo.Count + pro.en_cours.Count, ind);
                        }
                    }
                    name.Text = "P" + (pro.fifo.Count + pro.en_cours.Count + 1).ToString();
                }
                else
                {
                    /*taillebar.Fill = new SolidColorBrush(Color.FromRgb(201, 10, 1));
                     *                  tempbar.Fill = new SolidColorBrush(Color.FromRgb(201, 10, 1));*/
                }
            }


            System.Timers.Timer timer = new System.Timers.Timer(500);
            timer.Start();
            timer.Elapsed += delegate(object sender1, ElapsedEventArgs ev) { Change_color(sender1, ev); };
        }