Beispiel #1
0
        void OfflineService_OfflinePackProgressChanged(object sender, OSSEventArgs e)
        {
            var   progress   = e.OfflinePack.Progress;
            float percentage = 0;

            if (progress.CountOfResourcesExpected > 0)
            {
                percentage = (float)progress.CountOfResourcesCompleted / progress.CountOfResourcesExpected;
            }

            Debug.WriteLine($"Downloaded resources: {progress.CountOfResourcesCompleted} ({percentage * 100} %)");
            Debug.WriteLine($"Downloaded tiles: {progress.CountOfTilesCompleted}");
            if (progress.CountOfResourcesExpected == progress.CountOfResourcesCompleted)
            {
                Debug.WriteLine("Download completed");
            }
        }
Beispiel #2
0
        private void OfflineService_OfflinePackProgressChanged(object sender, OSSEventArgs e)
        {
            var   progress   = e.OfflinePack.Progress;
            float percentage = 0;

            if (progress.CountOfResourcesExpected > 0)
            {
                percentage = (float)progress.CountOfResourcesCompleted / progress.CountOfResourcesExpected;
            }

            Device.BeginInvokeOnMainThread(() =>
            {
                txtProgress.Text = $"({(percentage).ToString("P")}) >> {progress.CountOfResourcesCompleted} / {progress.CountOfResourcesExpected}";
            });

            System.Diagnostics.Debug.WriteLine($"Downloaded resources: {progress.CountOfResourcesCompleted} ({percentage * 100} %)");
            System.Diagnostics.Debug.WriteLine($"Downloaded tiles: {progress.CountOfTilesCompleted}");
            if (progress.CountOfResourcesExpected == progress.CountOfResourcesCompleted)
            {
                System.Diagnostics.Debug.WriteLine("Download completed");
            }
        }