IGeolocation.cs 908 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Drawing;
  2. using InABox.Core;
  3. namespace InABox.Avalonia.Platform;
  4. public class GeoLocationTimerArgs(TimeSpan frequency, TimeSpan remaining) : EventArgs
  5. {
  6. public TimeSpan Frequency { get; } = frequency;
  7. public TimeSpan Remaining { get; } = remaining;
  8. }
  9. public delegate void GeoLocationTimerHandler(object sender, GeoLocationTimerArgs e);
  10. public class GeoLocationChangedArgs(GeoPoint? location) : EventArgs
  11. {
  12. public GeoPoint? Location { get; } = location;
  13. }
  14. public delegate void GeoLocationChangedHandler(object sender, GeoLocationChangedArgs e);
  15. public interface IGeolocation : ILoggable
  16. {
  17. bool Scanning { get; set; }
  18. GeoPoint? CurrentLocation { get; set; }
  19. public event GeoLocationChangedHandler? LocationChanged;
  20. public event GeoLocationTimerHandler? TimerChanged;
  21. Task<GeoPoint?> GetLocationAsync(CancellationTokenSource cancel);
  22. }