Replace Path.GetFullPath

This commit is contained in:
ClemensFischer 2022-12-05 23:34:03 +01:00
parent 7b69215a30
commit a342f98334
3 changed files with 9 additions and 4 deletions

View file

@ -131,7 +131,8 @@ namespace MapControl
{
using (var archive = await Task.Run(() => ZipFile.OpenRead(archiveFilePath)))
{
var docEntry = await Task.Run(() => archive.GetEntry("doc.kml") ?? archive.Entries.FirstOrDefault(e => e.Name.EndsWith(".kml")));
var docEntry = await Task.Run(() => archive.GetEntry("doc.kml")
?? archive.Entries.FirstOrDefault(e => e.Name.EndsWith(".kml")));
if (docEntry == null)
{
@ -173,7 +174,8 @@ namespace MapControl
private static async Task<IEnumerable<ImageOverlay>> ReadGroundOverlaysFromFileAsync(string docFilePath)
{
docFilePath = Path.GetFullPath(docFilePath);
docFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, docFilePath);
var docUri = new Uri(docFilePath);
var imageOverlays = await Task.Run(() =>

View file

@ -20,7 +20,8 @@ namespace MapControl
{
public static async Task<Tuple<BitmapSource, Matrix>> ReadGeoTiff(string sourcePath)
{
var file = await StorageFile.GetFileFromPathAsync(Path.GetFullPath(sourcePath));
var file = await StorageFile.GetFileFromPathAsync(
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, sourcePath));
using (var stream = await file.OpenReadAsync())
{

View file

@ -50,9 +50,11 @@ namespace MapControl
{
ImageSource image = null;
path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path);
if (File.Exists(path))
{
var file = await StorageFile.GetFileFromPathAsync(Path.GetFullPath(path));
var file = await StorageFile.GetFileFromPathAsync(path);
using (var stream = await file.OpenReadAsync())
{