mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Cleanup of global usings
This commit is contained in:
parent
0a427a90de
commit
81eabef257
57 changed files with 207 additions and 54 deletions
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ using Windows.UI.Xaml;
|
|||
#elif WINUI
|
||||
global using DispatcherTimer = Microsoft.UI.Dispatching.DispatcherQueueTimer;
|
||||
using Microsoft.UI.Xaml;
|
||||
#elif AVALONIA
|
||||
using DependencyObject = Avalonia.AvaloniaObject;
|
||||
using Avalonia.Threading;
|
||||
#endif
|
||||
using System;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
namespace MapControl
|
||||
using System.IO;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public static class FilePath
|
||||
{
|
||||
public static string GetFullPath(string path)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
return System.IO.Path.GetFullPath(path, System.AppDomain.CurrentDomain.BaseDirectory);
|
||||
return Path.GetFullPath(path, System.AppDomain.CurrentDomain.BaseDirectory);
|
||||
#else
|
||||
return System.IO.Path.GetFullPath(path);
|
||||
return Path.GetFullPath(path);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,11 @@ using Microsoft.UI.Xaml.Media;
|
|||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
using Shape = Microsoft.UI.Xaml.Shapes.Shape;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using Shape = Avalonia.Controls.Shapes.Shape;
|
||||
using BitmapSource = Avalonia.Media.Imaging.Bitmap;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
@ -43,6 +47,26 @@ namespace MapControl
|
|||
LatLonBox = projection != null
|
||||
? new LatLonBox(projection.MapToBoundingBox(new Rect(p1, p2)))
|
||||
: new LatLonBox(p1.Y, p1.X, p2.Y, p2.X);
|
||||
|
||||
#if DEBUG && NET6_0_OR_GREATER && !AVALONIA
|
||||
System.Diagnostics.Debug.WriteLine(
|
||||
string.Create(CultureInfo.InvariantCulture,
|
||||
$"proj {projection?.CrsId ?? "-"}\n" +
|
||||
$"SizeX {bitmap.PixelWidth}\n" +
|
||||
$"SizeY {bitmap.PixelHeight}\n" +
|
||||
$"M11 {transform.M11}\n" +
|
||||
$"M22 {transform.M22}\n" +
|
||||
$"OfsX {transform.OffsetX}\n" +
|
||||
$"OfsY {transform.OffsetY}\n" +
|
||||
$"X1 {p1.X}\n" +
|
||||
$"Y1 {p1.Y}\n" +
|
||||
$"X2 {p2.X}\n" +
|
||||
$"Y2 {p2.Y}\n" +
|
||||
$"West {LatLonBox.West}\n" +
|
||||
$"South {LatLonBox.South}\n" +
|
||||
$"East {LatLonBox.East}\n" +
|
||||
$"North {LatLonBox.North}\n"));
|
||||
#endif
|
||||
}
|
||||
|
||||
public BitmapSource BitmapSource { get; }
|
||||
|
|
@ -119,7 +143,7 @@ namespace MapControl
|
|||
|
||||
private static async Task<GeoBitmap> LoadGeoBitmap(string sourcePath)
|
||||
{
|
||||
var ext = Path.GetExtension(sourcePath);
|
||||
var ext = System.IO.Path.GetExtension(sourcePath);
|
||||
|
||||
if (ext.Length >= 4)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ using Windows.UI.Xaml.Media;
|
|||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ using System.Windows;
|
|||
using Windows.UI.Xaml;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ using Windows.UI.Xaml.Media;
|
|||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Controls;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ using Windows.UI.Xaml.Media;
|
|||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ using System.Windows;
|
|||
using Windows.UI.Xaml;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ using Windows.UI.Xaml.Media;
|
|||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
using PathFigureCollection = Avalonia.Media.PathFigures;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -14,6 +14,11 @@ using Windows.UI.Xaml.Media;
|
|||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Threading;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -7,10 +7,11 @@ using Windows.UI.Xaml.Media;
|
|||
#elif WINUI
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
#endif
|
||||
|
||||
using System;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ using Windows.UI.Xaml.Data;
|
|||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Data;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
@ -118,18 +122,18 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
|
||||
private void PrepareContainer(DependencyObject container, object item)
|
||||
private void PrepareContainer(MapItem mapItem, object item)
|
||||
{
|
||||
if (LocationMemberPath != null && container is MapItem mapItem)
|
||||
if (LocationMemberPath != null)
|
||||
{
|
||||
mapItem.SetBinding(MapItem.LocationProperty,
|
||||
new Binding { Source = item, Path = new PropertyPath(LocationMemberPath) });
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearContainer(DependencyObject container)
|
||||
private void ClearContainer(MapItem mapItem)
|
||||
{
|
||||
if (LocationMemberPath != null && container is MapItem mapItem)
|
||||
if (LocationMemberPath != null)
|
||||
{
|
||||
mapItem.ClearValue(MapItem.LocationProperty);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,11 @@ using Windows.Foundation;
|
|||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.Media;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ using System.Windows;
|
|||
using Windows.UI.Xaml;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -21,7 +21,12 @@ using Microsoft.UI.Xaml.Data;
|
|||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Shapes;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Shapes;
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Layout;
|
||||
using PointCollection = System.Collections.Generic.List<Avalonia.Point>;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ using Windows.UI.Xaml.Media;
|
|||
using Windows.Foundation;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ using Microsoft.UI.Xaml;
|
|||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Hosting;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Threading;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ using Windows.UI.Xaml.Media;
|
|||
using Windows.Foundation;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.Media;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ using Windows.UI.Xaml.Media;
|
|||
#elif WINUI
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ using System.Windows.Data;
|
|||
using Windows.UI.Xaml.Data;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Data.Converters;
|
||||
#endif
|
||||
#if UWP || WINUI
|
||||
using ConverterCulture = System.String;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ using System.Windows.Media;
|
|||
using Windows.UI.Xaml.Media;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ using Windows.UI.Xaml.Media;
|
|||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ using System.Threading.Tasks;
|
|||
using System.Xml.Linq;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ using Windows.UI.Xaml;
|
|||
#elif WINUI
|
||||
using Windows.Foundation;
|
||||
using Microsoft.UI.Xaml;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
using Avalonia.Interactivity;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ using Windows.UI.Xaml.Media;
|
|||
using Windows.Foundation;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
#elif AVALONIA
|
||||
using Avalonia;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue