示例#1
0
        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);
                }
            }
        }
示例#2
0
        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);
                }
            }
        }
示例#3
0
        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();
        }