mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 05:47:28 +02:00
Version 3.0.338
This commit is contained in:
parent
573fe77e12
commit
0468955d49
751 changed files with 62747 additions and 60672 deletions
|
@ -1,14 +1,14 @@
|
|||
namespace TINK.Model.Map
|
||||
{
|
||||
public interface IMapSpan
|
||||
{
|
||||
/// <summary> Center of map displayed area.</summary>
|
||||
IPosition Center { get; }
|
||||
public interface IMapSpan
|
||||
{
|
||||
/// <summary> Center of map displayed area.</summary>
|
||||
IPosition Center { get; }
|
||||
|
||||
/// <summary> Radius of displayed map area. </summary>
|
||||
double Radius { get; }
|
||||
/// <summary> Radius of displayed map area. </summary>
|
||||
double Radius { get; }
|
||||
|
||||
/// <summary> Gets if map span is valid or not. </summary>
|
||||
bool IsValid { get; }
|
||||
}
|
||||
/// <summary> Gets if map span is valid or not. </summary>
|
||||
bool IsValid { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,29 +2,29 @@
|
|||
|
||||
namespace TINK.Model.Map
|
||||
{
|
||||
/// <summary> Holds the displayed map area. </summary>
|
||||
public class MapSpan : IMapSpan
|
||||
{
|
||||
internal MapSpan(IPosition center, double radius)
|
||||
{
|
||||
if (!GetIsValid(center, radius))
|
||||
throw new ArgumentNullException();
|
||||
/// <summary> Holds the displayed map area. </summary>
|
||||
public class MapSpan : IMapSpan
|
||||
{
|
||||
internal MapSpan(IPosition center, double radius)
|
||||
{
|
||||
if (!GetIsValid(center, radius))
|
||||
throw new ArgumentNullException();
|
||||
|
||||
Center = center;
|
||||
Radius = radius;
|
||||
}
|
||||
Center = center;
|
||||
Radius = radius;
|
||||
}
|
||||
|
||||
/// <summary> Center of map displayed area.</summary>
|
||||
public IPosition Center { get; }
|
||||
/// <summary> Center of map displayed area.</summary>
|
||||
public IPosition Center { get; }
|
||||
|
||||
/// <summary> Radius of displayed map area. </summary>
|
||||
public double Radius { get; }
|
||||
/// <summary> Radius of displayed map area. </summary>
|
||||
public double Radius { get; }
|
||||
|
||||
public bool IsValid => GetIsValid(Center, Radius);
|
||||
public bool IsValid => GetIsValid(Center, Radius);
|
||||
|
||||
public static bool GetIsValid(IPosition center, double radius)
|
||||
=> center != null
|
||||
&& center.IsValid
|
||||
&& !double.IsNaN(radius);
|
||||
}
|
||||
public static bool GetIsValid(IPosition center, double radius)
|
||||
=> center != null
|
||||
&& center.IsValid
|
||||
&& !double.IsNaN(radius);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
|
||||
namespace TINK.Model.Map
|
||||
{
|
||||
public static class MapSpanFactory
|
||||
{
|
||||
public static IMapSpan Create(IPosition position = null, double radius = double.NaN)
|
||||
=> MapSpan.GetIsValid(position, radius)
|
||||
? new MapSpan(position, radius) as IMapSpan
|
||||
: new NullMapSpan();
|
||||
}
|
||||
public static class MapSpanFactory
|
||||
{
|
||||
public static IMapSpan Create(IPosition position = null, double radius = double.NaN)
|
||||
=> MapSpan.GetIsValid(position, radius)
|
||||
? new MapSpan(position, radius) as IMapSpan
|
||||
: new NullMapSpan();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
|
||||
namespace TINK.Model.Map
|
||||
{
|
||||
public class NullMapSpan : IMapSpan
|
||||
{
|
||||
internal NullMapSpan() { }
|
||||
public class NullMapSpan : IMapSpan
|
||||
{
|
||||
internal NullMapSpan() { }
|
||||
|
||||
/// <summary> Center of map displayed area.</summary>
|
||||
public IPosition Center { get; } = PositionFactory.Create();
|
||||
/// <summary> Center of map displayed area.</summary>
|
||||
public IPosition Center { get; } = PositionFactory.Create();
|
||||
|
||||
/// <summary> Radius of displayed map area. </summary>
|
||||
public double Radius => double.NaN;
|
||||
/// <summary> Radius of displayed map area. </summary>
|
||||
public double Radius => double.NaN;
|
||||
|
||||
public bool IsValid => MapSpan.GetIsValid(Center, Radius);
|
||||
}
|
||||
public bool IsValid => MapSpan.GetIsValid(Center, Radius);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue