예제 #1
0
        public List<BitmapSource> GetImages(ImageCollection collection)
        {
            String response = HttpPost("GetPhotosByCollection", "WebPhotoCollectionID=" + collection.ID);

            List<BitmapSource> images = new List<BitmapSource>();

            XElement element = XElement.Parse(response);

            var imagesXml = from image in element.Descendants()
                            where image.Name.LocalName == "MainPhotoURL"
                         select image.Value;


            foreach (String image in imagesXml)
            {
                BitmapImage img = new BitmapImage(new Uri(image));
                images.Add(img);
            }

            return images;
        }