mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Version 4.10.0: Simplified TileImageLoader.
This commit is contained in:
parent
be3a247064
commit
bbd952b955
2 changed files with 10 additions and 10 deletions
|
|
@ -5,20 +5,20 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
#pragma warning disable CS1998 // async method lacks await operators and will run synchronously
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public class XmlDocument : System.Xml.XmlDocument
|
||||
{
|
||||
public static XmlDocument LoadFromUri(Uri uri)
|
||||
{
|
||||
var document = new XmlDocument();
|
||||
document.Load(uri.ToString());
|
||||
return document;
|
||||
}
|
||||
|
||||
public static Task<XmlDocument> LoadFromUriAsync(Uri uri)
|
||||
{
|
||||
return Task.Run(async () => // without async, debugger may stop on unhandled exception from XmlDocument.Load
|
||||
{
|
||||
var document = new XmlDocument();
|
||||
document.Load(uri.ToString());
|
||||
return document;
|
||||
});
|
||||
return Task.Run(() => LoadFromUri(uri));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue