示例#1
0
        //здесь начинается выполнение фоновой задачи
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            // Get a deferral, to prevent the task from closing prematurely
            // while asynchronous code is still running.
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            // Download the and save JSON to file.
            string jsonText = GetAndSaveJson();

            //Desserealize JSON
            var biddingSearchResults = ReadJson(jsonText);

            if (biddingSearchResults == null)
            {
                deferral.Complete();
            }
            // Update the live tile with the feed items.
            else
            {
                var tileUpdater = new TileUpdater();
                tileUpdater.UpdateTile(biddingSearchResults);
            }

            // Inform the system that the task is finished.
            deferral.Complete();
        }
示例#2
0
        //здесь начинается выполнение фоновой задачи
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            // Get a deferral, to prevent the task from closing prematurely
            // while asynchronous code is still running.
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            // Download the and save JSON to file.
            await GetJson();

            //Read data from JSON file
            var biddingSearchResults = ReadJson();

            // Update the live tile with the feed items.
            var tileUpdater = new TileUpdater();

            tileUpdater.UpdateTile(biddingSearchResults);


            // Inform the system that the task is finished.
            deferral.Complete();
        }