async Task Match(Match game) { List <RetourMatch> res = game.NextMinute(); if (Utils.RetoursContient(RetourMatchEvenement.FIN_MATCH, res)) { _enCours[_matchs.IndexOf(game)] = false; } //Si y a un évenement if (Utils.RetoursContient(RetourMatchEvenement.EVENEMENT, res)) { MatchEvent em = game.events[game.events.Count - 1]; string icone = ""; bool afficherAction = false; if (em.type == GameEvent.Goal || em.type == GameEvent.PenaltyGoal || em.type == GameEvent.AgGoal) { icone = "goal.png"; afficherAction = true; if (em.club == game.home) { _media.But(game); } if (cbJingleBut.IsChecked == true) { _media.AjouterSon("jingle", false); } //Refresh en cas de but Matchs(); Classement(); } else if (em.type == GameEvent.YellowCard) { icone = "yellow_card.png"; afficherAction = true; } else if (em.type == GameEvent.RedCard) { icone = "red_card.png"; afficherAction = true; } if (afficherAction) { StackPanel spAction = new StackPanel(); spAction.Orientation = Orientation.Horizontal; spAction.Children.Add(ViewUtils.CreateImage(Utils.Image(icone), 20, 20)); spAction.Children.Add(ViewUtils.CreateLabel(em.MinuteToString, "StyleLabel2", 11, 25, System.Windows.Media.Brushes.LightSalmon, null, true)); spAction.Children.Add(ViewUtils.CreateLabel(game.home.shortName + " - " + game.away.shortName + " : " + game.score1 + " - " + game.score2, "StyleLabel2", 11, 210, icone == "red_card.png" ? System.Windows.Media.Brushes.LightSalmon : null, null, icone == "goal.png" || icone == "red_card.png")); spAction.Children.Add(ViewUtils.CreateLabel(em.player.lastName + " (" + em.player.Club.shortName + ")", "StyleLabel2", 11, 125, null, null, icone == "goal.png")); spOtherActions.Children.Insert(0, spAction); } if (game == _matchs[0]) { ActionsMatch(); } } //Refresh if (game == _matchs[0]) { lbTemps.Content = game.Time; lbScore1.Content = game.score1; lbScore2.Content = game.score2; lbTirs1.Content = game.statistics.HomeShoots; lbTirs2.Content = game.statistics.AwayShoots; pbTirs.Maximum = game.statistics.HomeShoots + game.statistics.AwayShoots; pbTirs.Value = game.statistics.HomeShoots; } //Thread t = new Thread(new ThreadStart(ThreadClassement)); //t.Start(); await Task.Delay((int)sliderVitesseSimulation.Value) /*.ConfigureAwait(false)*/; }