Exemple #1
0
        void LoadImagesAsynchronously()
        {
            List <string> urls = m_smugMugFeed.Fetch();

            int i = 0;

            foreach (string url in urls)
            {
                ImageItem imageItem = new ImageItem();
                imageItem.ImageReady += imageItem_ImageReady;
                imageItem.LoadImageStart(url);
                i++;
                if (i == 100)
                {
                    break;
                }
            }
        }
Exemple #2
0
        void LoadImagesSynchronously()
        {
            List <string> urls = m_smugMugFeed.Fetch();

            int i = 0;

            foreach (string url in urls)
            {
                ImageItem imageItem = new ImageItem();
                imageItem.LoadImageSynchronously(url);

                m_AllImages.Add(imageItem);
                i++;
                if (i == 50)
                {
                    break;
                }
            }
        }
Exemple #3
0
        async void LoadImagesAsyncNewInOrder()
        {
            List <string> urls = m_smugMugFeed.Fetch();

            int i = 0;

            foreach (string url in urls)
            {
                ImageItem imageItem = new ImageItem();
                await imageItem.LoadImageAsync(url);

                AddImageToUI(imageItem);

                i++;
                if (i == 100)
                {
                    break;
                }
            }
        }
Exemple #4
0
 void AddImageToUI(ImageItem imageItem)
 {
     m_AllImages.Add(imageItem);
     ImageCount = "Count: " + m_AllImages.Count.ToString();
 }
Exemple #5
0
        void imageItem_ImageReady(object sender, EventArgs e)
        {
            ImageItem imageItem = (ImageItem)sender;

            Dispatcher.BeginInvoke(new Action <ImageItem>(AddImageToUI), imageItem);
        }