private async void CheckForScheduledUpdates() { try { // Get the information for offline updates. OfflineMapUpdatesInfo info = await _offlineMapSyncTask.CheckForUpdatesAsync(); // Check if there are updates that can be downloaded. if (info.DownloadAvailability == OfflineUpdateAvailability.Available) { // Get the size of the update. double updateSize = info.ScheduledUpdatesDownloadSize / 1024; // Update the UI. _infoLabel.Text = $"Updates: {info.DownloadAvailability}\nUpdate size: {updateSize} kilobytes."; _applyButton.Enabled = true; } else { // Update the UI. _infoLabel.Text = $"Updates: {info.DownloadAvailability}\nThe preplanned map area is up to date."; _applyButton.Enabled = false; } } catch (Exception ex) { new AlertDialog.Builder(this).SetMessage(ex.Message).SetTitle("Error").Show(); } }
private async void CheckForScheduledUpdates() { try { // Get the information for offline updates. OfflineMapUpdatesInfo info = await _offlineMapSyncTask.CheckForUpdatesAsync(); // Check if there are updates that can be downloaded. if (info.DownloadAvailability == OfflineUpdateAvailability.Available) { // Get the size of the update. double updateSize = info.ScheduledUpdatesDownloadSize / 1024;; // Update the UI. InfoLabel.Content = $"Updates: {info.DownloadAvailability}\nUpdate size: {updateSize} kilobytes."; ApplyButton.IsEnabled = true; } else { // Update the UI. InfoLabel.Content = $"Updates: {info.DownloadAvailability}\nThe preplanned map area is up to date."; ApplyButton.IsEnabled = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } }
private async void CheckForScheduledUpdates() { try { // Get the information for offline updates. OfflineMapUpdatesInfo info = await _offlineMapSyncTask.CheckForUpdatesAsync(); // Check if there are updates that can be downloaded. if (info.DownloadAvailability == OfflineUpdateAvailability.Available) { // Get the size of the update. double updateSize = info.ScheduledUpdatesDownloadSize / 1024; // Update the UI. _statusLabel.Text = $"Updates: {info.DownloadAvailability}\nUpdate size: {updateSize} kilobytes."; _applyButton.Enabled = true; } else { // Update the UI. _statusLabel.Text = $"Updates: {info.DownloadAvailability}\nThe preplanned map area is up to date."; _applyButton.Enabled = false; } } catch (Exception ex) { new UIAlertView("Error", ex.Message, (IUIAlertViewDelegate)null, "OK", null).Show(); } }