Beispiel #1
0
        public async Task <ImageSizesEntity> GetImageSizesAsync()
        {
            // NOTE: We need to append -0 to the image key otherwise we will not get the right value
            // /image/(*)!sizes
            //return await image____sizes();

            // /image/(*)!sizes

            // get the image key from the Uris if possible

            string        imgKey = ImageKey;
            UriDescriptor val;

            if (Uris.TryGetValue("Image", out val))
            {
                var posLastSlash = val.Uri.LastIndexOf("/");
                if (posLastSlash >= 0)
                {
                    imgKey = val.Uri.Substring(posLastSlash + 1);
                }
            }

            string requestUri = string.Format("{0}/image/{1}!sizes", SmugMug.v2.Constants.Addresses.SmugMugApi, imgKey);

            return(await RetrieveEntityAsync <ImageSizesEntity>(requestUri));
        }