Ejemplo n.º 1
0
        void source_GetEntriesCompleted(object sender, GetEntriesCompletedEventArgs args)
        {
#if DEBUG
            DebugUtility.DebugOutputMemoryUsage("Beginning Entries Completed Handler");
#endif
            source = null;
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
            System.GC.Collect();
            service = new PhoneTileUpdateService();

            var tileContacts = new List <BirthdayContact>();
            if (args.Contacts.Any())
            {
                tileContacts = args.Contacts.OrderBy(it => it.DaysUntil).Take(3).ToList();
            }
            //var count = args.Contacts.Where(it => it.DaysUntil == 0).Count();
            var count = 0;

            args.Contacts = null;
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
            System.GC.Collect();

            service.UpdateTileSynchronous(tileContacts, count, UpdateTileCompleted);
        }
Ejemplo n.º 2
0
        void UpdateTileCompleted()
        {
            service = null;
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
            System.GC.Collect();
#if DEBUG
            DebugUtility.DebugOutputElapsedTime("Scheduled Task Final Time Snapshot:");
            DebugUtility.DebugOutputMemoryUsage("Scheduled Task Final Memory Snapshot");
#endif

#if (DEBUG_AGENT)
            //			ScheduledActionService.LaunchForTest("StirlingBirthdayTileUpdateTask", TimeSpan.FromSeconds(60));
#endif

            NotifyComplete();
        }