예제 #1
0
        public static void Load(params CoverageLeague[] coverageLeagues)
        {
            foreach (var coverageLeague in coverageLeagues)
            {
                string key = MakeCoverageLeagueKey(coverageLeague.CountryName, coverageLeague.LeagueName);

                Debug.Assert(!CoverageLeagues.ContainsKey(key), $"Alread exist key in Dic_CoverageLeagues key: {key}");

                // 기본 이미지 설정
                if (string.IsNullOrEmpty(coverageLeague.CountryLogo))
                {
                    coverageLeague.CountryLogo = "img_world.png";
                }
                if (string.IsNullOrEmpty(coverageLeague.LeagueLogo))
                {
                    coverageLeague.LeagueLogo = coverageLeague.CountryLogo;
                }

                var leagueInfo = new FootballLeagueInfo
                {
                    CountryName  = coverageLeague.CountryName,
                    CountryLogo  = coverageLeague.CountryLogo,
                    LeagueName   = coverageLeague.LeagueName,
                    LeagueLogo   = coverageLeague.LeagueLogo,
                    LeagueType   = coverageLeague.LeagueType,
                    IsBookmarked = false,
                };

                CoverageLeagues.Add(key, leagueInfo);
            }
        }
        public FootballLeagueInfo Convert(FootballLeagueDetail leagueDetail)
        {
            // 기본 이미지 설정
            if (string.IsNullOrEmpty(leagueDetail.Country.Logo))
            {
                leagueDetail.Country.Logo = "img_world.png";
            }
            if (string.IsNullOrEmpty(leagueDetail.Logo))
            {
                leagueDetail.Logo = leagueDetail.Country.Logo;
            }

            var returnValue = new FootballLeagueInfo
            {
                CountryName     = leagueDetail.Country.Name,
                CountryLogo     = leagueDetail.Country.Logo,
                LeagueName      = leagueDetail.Name,
                LeagueLogo      = leagueDetail.Logo,
                LeagueType      = leagueDetail.LeagueType,
                SeasonStartDate = leagueDetail.SeasonStartDate,
                SeasonEndDate   = leagueDetail.SeasonEndDate,
                IsBookmarked    = false,
            };

            return(returnValue);
        }
예제 #3
0
        public FootballLeagueInfo Convert(FootballMatchInfo matchInfo)
        {
            var returnValue = new FootballLeagueInfo
            {
                CountryName  = matchInfo.League_CountryName,
                CountryLogo  = matchInfo.League_CountryLogo,
                LeagueName   = matchInfo.LeagueName,
                LeagueLogo   = matchInfo.LeagueLogo,
                LeagueType   = matchInfo.LeagueType,
                IsBookmarked = false,
            };

            return(returnValue);
        }
 public FootballLeagueDetail Reverse(FootballLeagueInfo value)
 {
     return(new FootballLeagueDetail
     {
         Country = new FootballCountryDetail
         {
             Logo = value.CountryLogo,
             Name = value.CountryName,
         },
         Name = value.LeagueName,
         Logo = value.LeagueLogo,
         LeagueType = value.LeagueType,
         SeasonStartDate = value.SeasonStartDate,
         SeasonEndDate = value.SeasonEndDate
     });
 }