GetStorageFileAsync() public static method

public static GetStorageFileAsync ( Uri uri ) : Task
uri System.Uri
return Task
Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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));
         }
     });
 }