private void _admin_UpdateProfil(StandardServerProfilInfo infos) { _userID = infos.UserID; img_avatar.Source = PicsManager.GetCustom(infos.Avatar); img_border.Source = PicsManager.GetCustom(infos.Border); img_sleeve.Source = PicsManager.GetCustom(infos.Sleeve); img_partner.Source = PicsManager.GetCustom(infos.Partner); tb_username.Text = infos.Username; tb_level.Text = infos.Level.ToString(); tb_experience.Text = infos.Exp.ToString(); tb_cardcount.Text = infos.CardNumber.ToString(); tb_rankedwin.Text = infos.RankedWin.ToString(); tb_rankedlose.Text = infos.RankedLose.ToString(); tb_rankeddraw.Text = infos.RankedDraw.ToString(); tb_elo.Text = infos.ELO.ToString(); tb_rank.Text = infos.Rank.ToString(); tb_ranking.Text = infos.Ranking != 0 ? infos.Ranking.ToString() : "NC"; tb_single.Text = infos.SingleWin.ToString() + "|" + infos.SingleLose.ToString() + "|" + infos.SingleDraw.ToString(); tb_match.Text = infos.MatchWin.ToString() + "|" + infos.MatchLose.ToString() + "|" + infos.MatchDraw.ToString(); tb_tag.Text = infos.TagWin.ToString() + "|" + infos.TagLose.ToString() + "|" + infos.TagDraw.ToString(); tb_ragequit.Text = infos.RageQuit.ToString(); tb_giveup.Text = infos.GiveUp.ToString(); tb_title.Text = infos.Title; if (infos.TeamID != 0) { tb_rank.Visibility = Visibility.Hidden; ImageBrush background = new ImageBrush(FormExecution.AssetsManager.GetTeamEmblem(infos.TeamID, infos.TeamEmblem)); background.Stretch = Stretch.UniformToFill; team_emblem.Background = background; team_emblem.MouseLeftButtonDown += (sender, e) => Img_border_MouseLeftButtonDown(sender, e, infos.TeamID); this.tb_teamname.Text = infos.TeamName; team_emblem.MouseEnter += Team_emblem_MouseEnter; team_emblem.MouseLeave += Team_emblem_MouseLeave;; } else { team_border.Visibility = Visibility.Hidden; Grid.SetColumnSpan(player_infos, 2); Grid.SetColumn(player_infos, 0); } this.Show(); Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() => this.Activate())); }
private void Client_ProfilUpdate(StandardServerProfilInfo infos) { Application.Current.Dispatcher.Invoke(() => UpdateProfil?.Invoke(infos)); }