public static void UpdateTile() { TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true); if (AutoDelete.AutoDeleteStatus) { AutoDelete.DeleteOutDatedCoverEvents(); } CoverEventsManager.AddCoverEventsDays(); CoverEventsManager.WriteCoverEventsCollectionData(); ClearTile(); foreach (var eachEvent in CoverEventsManager.CoverEventsCollection) { string url = eachEvent.imageUrl; if (url != null) { createTileUpdate(eachEvent, url); } else { createTileUpdate(eachEvent); } } }
public static void UpdateTileBG() { TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true); Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; Object AutoDeleteData = localSettings.Values["AutoDeleteData"]; Object coverEventsCollection = localSettings.Values["coverEventsCollection"]; if (coverEventsCollection != null) { String dataString = (string)coverEventsCollection; CoverEventsManager.CoverEventsCollection = ObjectSerializer.CoverEventsFromXml(dataString); } if (AutoDeleteData != null) { if ((bool)AutoDeleteData) { AutoDelete.DeleteOutDatedCoverEvents(); } } CoverEventsManager.AddCoverEventsDaysTileBG(); CoverEventsManager.WriteCoverEventsCollectionData(); ClearTile(); foreach (var eachEvent in CoverEventsManager.CoverEventsCollection) { string url = eachEvent.imageUrl; if (url != null) { createTileUpdate(eachEvent, url); } else { createTileUpdate(eachEvent); } } }
public static void DeleteOutDatedCoverEvents() { ObservableCollection <CoverEvents> coverEvents = CoverEventsManager.GetCoverEvents(); var resourceLoader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView(); for (int i = 0; i < coverEvents.Count; ++i) { if (coverEvents[i].check == resourceLoader.GetString("PastTag")) { CoverEventsManager.CoverEventsCollection.RemoveAt(i); CoverEventsManager.ResetCoverEventsHeader(i); } } if (CoverEventsManager.CoverEventsCollection.Count == 0) { string eventTitle = resourceLoader.GetString("DefaultCoverTitle"); DateTime eventDate = DateTimeOffset.Now.Date; CoverEventsManager.AddCoverEvents(eventTitle, eventDate); CoverEventsManager.AddCoverEventsDays(); } CoverEventsManager.WriteCoverEventsCollectionData(); }