private string GenerateReportDescription(GeofenceStateChangeReport report)
        {
            GeofenceState  state     = report.NewState;
            DateTimeOffset timestamp = report.Geoposition.Coordinate.Timestamp;

            string result = $"{report.Geofence.Id} {timestamp:G}";

            if (state == GeofenceState.Removed)
            {
                GeofenceRemovalReason reason = report.RemovalReason;
                if (reason == GeofenceRemovalReason.Expired)
                {
                    result += " (Removed/Expired)";
                }
                else if (reason == GeofenceRemovalReason.Used)
                {
                    result += " (Removed/Used)";
                }
            }
            else if (state == GeofenceState.Entered)
            {
                result += " (Entered)";
            }
            else if (state == GeofenceState.Exited)
            {
                result += " (Exited)";
            }
            return(result);
        }
示例#2
0
        private ToastNotification MakeToast(GeofenceStateChangeReport report, Alarm alarm)
        {
            var tost = new SimpleToast("You have entered location", alarm.Name, alarm.AlarmSound);

            return(new ToastNotification(tost.ToastBlueprint));
        }
示例#3
0
 public TriggeredAlarm(GeofenceStateChangeReport report, Alarm alarm)
 {
     Report = report;
     Alarm  = alarm;
 }