public static GetStorageFileAsync ( |
||
uri | ||
return | Task |
public static async Task <TestDisplayData> CreateAsync(SvgTest test) { var data = new TestDisplayData(test); var device = CanvasDevice.GetSharedDevice(false); data.ReferencePng = await DownloadPng(device, new Uri(test.ReferencePngUri)); var svgFile = await CachedData.GetStorageFileAsync(new Uri(test.SvgUri)); var svgDocument = await XmlDocument.LoadFromFileAsync(svgFile, new XmlLoadSettings() { ProhibitDtd = false }); data.Drawing = await SvgDrawing.LoadAsync(device, svgDocument); var description = svgDocument.SelectSingleNodeNS("//d:testDescription", "xmlns:d='http://www.w3.org/2000/02/svg/testsuite/description/'"); if (description != null) { data.Description = description.InnerText; } return(data); }
void BackgroundDownloadTestData() { Task.Run(async() => { foreach (var test in Tests) { Debug.WriteLine(string.Format("prefetch: {0}", test.SvgUri)); await CachedData.GetStorageFileAsync(new Uri(test.SvgUri)); Debug.WriteLine(string.Format("prefetch: {0}", test.ReferencePngUri)); await CachedData.GetStorageFileAsync(new Uri(test.ReferencePngUri)); } }); }