Ejemplo n.º 1
0
        public async Task <Bitmap> GetAvatarAsync(string name, HHotel hotel)
        {
            HUser user = await GetUserAsync(name, hotel).ConfigureAwait(false);

            if (user == null)
            {
                return(Resources.Avatar);
            }

            if (!_avatarCache.ContainsKey(user.FigureId))
            {
                using (Bitmap avatar = await SKore.GetAvatarAsync(user.FigureId, HSize.Medium).ConfigureAwait(false))
                {
                    _avatarCache[user.FigureId] = TrimAvatar(avatar);
                }
            }
            return(_avatarCache[user.FigureId]);
        }
Ejemplo n.º 2
0
        public async Task <Bitmap> GetAvatarAsync(string name, HHotel hotel)
        {
            HProfile profile = await GetProfileAsync(
                name, hotel).ConfigureAwait(false);

            if (profile == null)
            {
                return(Resources.Avatar);
            }

            if (!_avatarCache.ContainsKey(profile.User.FigureId))
            {
                Bitmap avatar = await SKore.GetAvatarAsync(
                    profile.User.FigureId, HSize.Medium).ConfigureAwait(false);

                _avatarCache[profile.User.FigureId] = avatar;
            }
            return(_avatarCache[profile.User.FigureId]);
        }
Ejemplo n.º 3
0
        public async Task <Bitmap> GetAvatarAsync(AuthorAttribute authorAtt)
        {
            HProfile profile = await GetProfileAsync(
                authorAtt).ConfigureAwait(false);

            if (profile == null)
            {
                return(Resources.Avatar);
            }

            if (_avatarCache.ContainsKey(profile.User.FigureId))
            {
                return(_avatarCache[profile.User.FigureId]);
            }

            Bitmap avatar = await SKore.GetAvatarAsync(
                profile.User.FigureId, HSize.Medium).ConfigureAwait(false);

            _avatarCache[profile.User.FigureId] = avatar;
            return(avatar);
        }