Пример #1
0
        /// <summary>
        /// Try to get the avatar immediately. This should work for people on your friends list.
        /// </summary>
        public Image GetCachedAvatar(AvatarSize size, ulong steamid)
        {
            var imageid = 0;

            switch (size)
            {
            case AvatarSize.Small:
                imageid = client.native.friends.GetSmallFriendAvatar(steamid);
                break;

            case AvatarSize.Medium:
                imageid = client.native.friends.GetMediumFriendAvatar(steamid);
                break;

            case AvatarSize.Large:
                imageid = client.native.friends.GetLargeFriendAvatar(steamid);
                break;
            }

            var img = new Image()
            {
                Id = imageid
            };

            if (imageid != 0 && img.TryLoad(client.native.utils))
            {
                return(img);
            }

            return(null);
        }
Пример #2
0
        public Image GetAvatar(AvatarSize size, ulong steamid)
        {
            var imageid = 0;

            switch (size)
            {
            case AvatarSize.Small:
                imageid = client.native.friends.GetSmallFriendAvatar(steamid);
                break;

            case AvatarSize.Medium:
                imageid = client.native.friends.GetMediumFriendAvatar(steamid);
                break;

            case AvatarSize.Large:
                imageid = client.native.friends.GetLargeFriendAvatar(steamid);
                break;
            }

            var img = new Image()
            {
                Id = imageid
            };

            if (imageid == 0)
            {
                return(img);
            }

            if (img.TryLoad(client.native.utils))
            {
                return(img);
            }

            throw new System.NotImplementedException("Deferred Avatar Loading Todo");
            // Add to image loading list

            //return img;
        }