internal async Task<string> GetLocalImageUrlAsync(ReportViewItem viewItem)
{
var cacheFolder = await this.GetCacheFolderAsync();
// build a path based on the native id...
var filename = GetCacheFilename(viewItem);
StorageFile cacheFile = null;
try
{
cacheFile = await cacheFolder.GetFileAsync(filename);
}
catch (FileNotFoundException ex)
{
SinkWarning(ex);
}
// did we get one?
if (cacheFile != null)
{
Debug.WriteLine(string.Format("Cache image for '{0}' was found locally...", viewItem.NativeId));
return CalculateLocalImageUrl(viewItem);
}
else
{
Debug.WriteLine(string.Format("Cache image for '{0}' was not found locally...", viewItem.NativeId));
return null;
}
}
}