Ejemplo n.º 1
0
        /// <summary>
        /// Gets a member's public profile picture.
        /// </summary>
        /// <param name="memberId">the member id</param>
        /// <param name="size">the desired size(small, medium, large, original)</param>
        /// <returns>blob with picture; empty blob (no fields set) if has no picture</returns>
        public Task <Blob> GetProfilePicture(string memberId, ProfilePictureSize size)
        {
            var request = new GetProfilePictureRequest
            {
                MemberId = memberId,
                Size     = size
            };

            return(gateway(authenticationContext()).GetProfilePictureAsync(request)
                   .ToTask(response => response.Blob));
        }
Ejemplo n.º 2
0
        public async Task <Uri> GetUserProfilePictureUrlAsync(String userIdentifier, ProfilePictureSize pictureSize)
        {
            var client          = new LiveConnectClient(_session);
            var path            = String.Format("{0}/picture?type={1}", userIdentifier, pictureSize.ToString().ToLowerInvariant());
            var operationResult = await client.GetAsync(path);

            //var operationResult = await client.GetAsync("me/picture?type=large");
            dynamic result   = operationResult.Result;
            var     imageUrl = new Uri(result.location.ToString());

            return(imageUrl);
        }
Ejemplo n.º 3
0
 public async Task <Uri> GetMyProfilePictureUrlAsync(ProfilePictureSize pictureSize)
 {
     return(await GetUserProfilePictureUrlAsync(Me, pictureSize));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets a member's public profile picture.
 /// </summary>
 /// <param name="memberId">member ID of member whose profile we want</param>
 /// <param name="size">desired size category (small, medium, large, original)</param>
 /// <returns>blob with picture; empty blob (no fields set) if has no picture</returns>
 public Blob GetProfilePictureBlocking(string memberId, ProfilePictureSize size)
 {
     return(GetProfilePicture(memberId, size).Result);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Gets a member's public profile picture.
 /// </summary>
 /// <param name="memberId">member ID of member whose profile we want</param>
 /// <param name="size">desired size category (small, medium, large, original)</param>
 /// <returns>blob with picture; empty blob (no fields set) if has no picture</returns>
 public Task <Blob> GetProfilePicture(string memberId, ProfilePictureSize size)
 {
     return(client.GetProfilePicture(memberId, size));
 }