public override void onRequestUpdate(MegaSDK api, MRequest request) { base.onRequestUpdate(api, request); if (request.getType() != MRequestType.TYPE_FETCH_NODES) { return; } if (request.getTotalBytes() > 0) { double progressValue = 100.0 * request.getTransferredBytes() / request.getTotalBytes(); if ((progressValue > 99) || (progressValue < 0)) { UiService.OnUiThread(() => ProgressService.SetProgressIndicator(true, ProgressMessages.PM_DecryptNodes)); } } if (AppMemoryController.IsThresholdExceeded(75UL.FromMBToBytes())) { UiService.OnUiThread(() => { new CustomMessageDialog( AppMessages.MemoryLimitError_Title, AppMessages.MemoryLimitError, App.AppInformation, MessageDialogButtons.Ok).ShowDialog(); Application.Current.Terminate(); }); } }
public override void onRequestUpdate(MegaSDK api, MRequest request) { Deployment.Current.Dispatcher.BeginInvoke(() => { ProgressService.ChangeProgressBarBackgroundColor((Color)Application.Current.Resources["PhoneChromeColor"]); ProgressService.SetProgressIndicator(true, String.Format(ProgressMessages.FetchingNodes, request.getTransferredBytes().ToStringAndSuffix(2))); }); if (AppMemoryController.IsThresholdExceeded(75UL.FromMBToBytes())) { Deployment.Current.Dispatcher.BeginInvoke(() => { new CustomMessageDialog( AppMessages.MemoryLimitError_Title, AppMessages.MemoryLimitError, App.AppInformation, MessageDialogButtons.Ok).ShowDialog(); Application.Current.Terminate(); }); } }