Exemplo n.º 1
0
        private async void ProcessPendingBackgroundOperations()
        {
            try
            {
                var pendingDownloadOperations = await LiveConnectClient.GetCurrentBackgroundDownloadsAsync();

                foreach (LiveDownloadOperation pendingOperation in pendingDownloadOperations)
                {
                    try
                    {
                        var opResult = await pendingOperation.AttachAsync();

                        // handle results
                    }
                    catch (Exception)
                    {
                        // handle errors
                    }
                }

                var pendingUploadOperations = await LiveConnectClient.GetCurrentBackgroundUploadsAsync();

                foreach (LiveUploadOperation pendingOperation in pendingUploadOperations)
                {
                    try
                    {
                        var opResult = await pendingOperation.AttachAsync();

                        // handle results
                    }
                    catch (Exception)
                    {
                        // handle errors
                    }
                }
            }
            catch (Exception)
            {
                // Handle errors
            }
        }