123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- 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<string> changes = new List<string>
- {
- "- 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<string> toDelete = new List<string>();
- 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);
- }
- }
- }
- }
- }
|