public void DisplayNextImage() { Console.WriteLine("-----displaying image " + imgIdx + " - " + DateTime.Now); SlideImage img = images[imgIdx]; if (!img.Ready) { Console.WriteLine("----bummer image not ready " + DateTime.Now); img.ImageReady += delegate { DisplayNextImage(); }; return; } if (active != null) { active.Remove(); } img.Add(); active = img; if (++imgIdx >= images.Count) { imgIdx = 0; } storyBoard.Begin(); }
public void DownloadImage (int idx) { Console.WriteLine ("Downloading "+idx); //Download images in a pipelines fashion //FIXME: use only one downloader instance once it supports been used multiple times. Downloader downloader = new Downloader (); if (idx + 1 < urls.Length) downloader.Completed += delegate { DownloadImage (idx + 1); }; SlideImage img = new SlideImage (this, urls [idx], downloader); images.Add (img); if (images.Count == 1) DisplayNextImage (); }
public void DownloadImage(int idx) { Console.WriteLine("Downloading " + idx); //Download images in a pipelines fashion //FIXME: use only one downloader instance once it supports been used multiple times. Downloader downloader = new Downloader(); if (idx + 1 < urls.Length) { downloader.Completed += delegate { DownloadImage(idx + 1); } } ; SlideImage img = new SlideImage(this, urls [idx], downloader); images.Add(img); if (images.Count == 1) { DisplayNextImage(); } }
public void DisplayNextImage () { Console.WriteLine ("-----displaying image "+imgIdx+" - "+DateTime.Now); SlideImage img = images[imgIdx]; if (!img.Ready) { Console.WriteLine ("----bummer image not ready "+DateTime.Now); img.ImageReady += delegate { DisplayNextImage(); }; return; } if (active != null) active.Remove (); img.Add(); active = img; if (++imgIdx >= images.Count) imgIdx = 0; storyBoard.Begin (); }