Ejemplo n.º 1
0
        public BitmapImage GetChampionIcon(int championId)
        {
            string name = null;

            if (championId != 0)
            {
                name = _gameData.GetChampionData(championId)?.Name;
            }

            return(new BitmapImage(new Uri(Path.Combine(_clientDir, name == null ? RandomIconFile : string.Format(IconFile, name)))));
        }
Ejemplo n.º 2
0
        public BitmapImage GetChampionIcon(int championId)
        {
            string name = null;

            if (championId != 0)
            {
                name = _gameData.GetChampionData(championId)?.Name;
            }
            BitmapImage bi;

            if (!iconCache.ContainsKey(championId))
            {
                bi = new BitmapImage(new Uri(Path.Combine(_clientDir, name == null ? RandomIconFile : string.Format(IconFile, name))));
                iconCache[championId] = bi;
                bi.Freeze();
            }
            else
            {
                bi = iconCache[championId];
            }
            return(bi);
        }