public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            var result = Constants.UnknowColor;

            try
            {
                PlayerDBDTO player = (PlayerDBDTO)values[0];
                GameDBDTO   info   = (GameDBDTO)values[1];
                if (player != null && info != null)
                {
                    if (player.Team == info.WinTeam)
                    {
                        return(result = Constants.WinColor);
                    }
                    else
                    {
                        return(result = Constants.LoseColor);
                    }
                }
            }
            catch (Exception e)
            {
            }
            return(result);
        }
示例#2
0
 public void GetGameFromDB()
 {
     if (gameInfo == null)
     {
         gameInfo = GameDatabase.Instance.QueryGame(String.Format("Id = {0} AND Platform = '{1}'", GameId, GamePlatform));
         if (gameInfo != null)
         {
             if (gameInfo.WinTeam == 100)
             {
                 IsBlueTeamWin = true;
             }
             else if (gameInfo.WinTeam == 200)
             {
                 IsPurpleTeamWin = true;
             }
         }
     }
     GetPlayersFromDB();
 }