public void DownloadImages(string rockUrl, FileCache.FileDownloaded onResult) { DownloadImage(LogoURL, LogoImageName, rockUrl, null); DownloadImage(BackgroundURL, BackgroundImageName, rockUrl, null); DownloadImage(AdultMaleNoPhoto, AdultMaleNoPhotoName, rockUrl, null); DownloadImage(AdultFemaleNoPhoto, AdultFemaleNoPhotoName, rockUrl, null); DownloadImage(ChildMaleNoPhoto, ChildMaleNoPhotoName, rockUrl, null); DownloadImage(ChildFemaleNoPhoto, ChildFemaleNoPhotoName, rockUrl, null); // dont make them wait. onResult(true); }
void DownloadImage(string imageUrl, string imageFileName, string rockUrl, FileCache.FileDownloaded onResult) { if (string.IsNullOrWhiteSpace(imageUrl) == false) { string qualifiedUrl; if (imageUrl[0] == '~') { qualifiedUrl = imageUrl.Replace("~", rockUrl); } else { qualifiedUrl = imageUrl; } FileCache.Instance.DownloadFileToCache(qualifiedUrl, imageFileName, FileCache.CacheFileNoExpiration, onResult); } }