GPSTrackerShell.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using Comal.Classes;
  3. using InABox.Mobile;
  4. using String = System.String;
  5. namespace PRS.Mobile
  6. {
  7. public class GPSTrackerShell : Shell<GPSTrackerModel, GPSTracker>
  8. {
  9. protected override void ConfigureColumns(ShellColumns<GPSTrackerModel, GPSTracker> columns)
  10. {
  11. columns
  12. .Map(nameof(DeviceID), x => x.DeviceID)
  13. .Map(nameof(Description), x => x.Description)
  14. .Map(nameof(Latitude), x => x.Location.Latitude)
  15. .Map(nameof(Longitude), x => x.Location.Longitude)
  16. .Map(nameof(Timestamp), x => x.Location.Timestamp)
  17. .Map(nameof(Address), x => x.Location.Address);
  18. }
  19. public String DeviceID => Get<String>();
  20. public String Description => Get<String>();
  21. public double Latitude => Get<double>();
  22. public double Longitude => Get<double>();
  23. public DateTime Timestamp => Get<DateTime>();
  24. public String Address => Get<String>();
  25. public InABox.Core.Location Location => new InABox.Core.Location()
  26. {
  27. Latitude = this.Latitude,
  28. Longitude = this.Longitude,
  29. Address = this.Address,
  30. Timestamp = this.Timestamp
  31. };
  32. }
  33. }