예제 #1
0
        public async Task <byte[]> GetPictureBytesAsync(Uri uri)
        {
            string cacheFileName = MakeCacheFileName(uri);
            var    cacheddata    = await FileCache.ReadItemBytesAsync(cacheFileName);

            if (cacheddata != null)
            {
                return(cacheddata);
            }
            var webData = await WebApi.RequestDataAsync(uri);

            await FileCache.WriteItemBytesAsync(cacheFileName, webData);

            return(webData);
        }