using InABox.Mobile; using System; using System.Collections.Generic; using System.Text; using System.Threading; using System.Threading.Tasks; using Xamarin.Forms; namespace comal.timesheets { public static class NotifyMobileChanges { public static string Notifiy() { RemoveOldProperties(); string latestChanges = ""; List changes = new List { "- Update to assignments (use actual/booked)", "- Improve digital form viewing from tasks", "- Improve PDF viewer for Androids" }; foreach (string s in changes) { latestChanges = s + System.Environment.NewLine + latestChanges; } if (App.Current.Properties.ContainsKey("NotifiedOfChanges" + MobileUtils.AppVersion.InstalledVersionNumber)) return ""; else { App.Current.Properties.Add("NotifiedOfChanges" + MobileUtils.AppVersion.InstalledVersionNumber, "True"); return latestChanges; } } private static void RemoveOldProperties() { if (App.Current.Properties.Count > 0) { List toDelete = new List(); foreach (string s in App.Current.Properties.Keys) { if (s.Contains("NotifiedOfChanges")) { if (!s.Equals("NotifiedOfChanges" + MobileUtils.AppVersion.InstalledVersionNumber)) { toDelete.Add(s); } } } foreach (string s in toDelete) { App.Current.Properties.Remove(s); } } } } }