private void UpdateElevationDataSize() { var totalFileSize = ElevationFileProvider.GetTotalElevationFileSize() / 1024f / 1024f; var totalFileSizeAsText = $"{totalFileSize:F1}"; _textViewElevationDataSize.Text = String.Format(Resources.GetText(Resource.String.Settings_ElevationDataSize), totalFileSizeAsText);; }
public bool Exists() { if (!_fileExists.HasValue) { _fileExists = ElevationFileProvider.ElevationFileExists((int)StartLocation.Latitude, (int)StartLocation.Longitude); } return(_fileExists.Value); }
private void ClearElevationData() { AlertDialog.Builder alert = new AlertDialog.Builder(this).SetCancelable(false); alert.SetPositiveButton(Resources.GetText(Resource.String.Common_Yes), (senderAlert, args) => { ElevationFileProvider.ClearElevationData(); AppContextLiveData.Instance.Database.DeleteAllDownloadedElevationData(); UpdateElevationDataSize(); }); alert.SetNegativeButton(Resources.GetText(Resource.String.Common_No), (senderAlert, args) => { }); alert.SetMessage(Resources.GetText(Resource.String.Settings_RemoveElevationDataQuestion)); var answer = alert.Show(); }
public bool Remove() { try { ElevationFileProvider.Remove((int)StartLocation.Latitude, (int)StartLocation.Longitude); return(true); } catch (Exception ex) { ErrorMessage = $"File delete error ({ex.Message})"; return(false); } }
public bool Download() { try { ElevationFileProvider.GetElevationFile((int)StartLocation.Latitude, (int)StartLocation.Longitude); return(true); } catch (Exception ex) { ErrorMessage = $"Download error ({ex.Message})"; return(false); } }
public bool LoadFromZip() { try { if (_elevationData == null) { if (ElevationFileProvider.ElevationFileExists((int)StartLocation.Latitude, (int)StartLocation.Longitude)) { var inputFileName = ElevationFileProvider.GetElevationFile((int)StartLocation.Latitude, (int)StartLocation.Longitude); LoadFromZip(inputFileName); return(true); } } return(false); } catch (Exception ex) { ErrorMessage = $"Load error ({ex.Message})"; return(false); } }
public long GetEelevationFileSize() { return(ElevationFileProvider.GetElevationFileSize((int)StartLocation.Latitude, (int)StartLocation.Longitude)); }
public float GetSizeToDownload() { return(_elevationTiles.Count(i => !i.Exists()) * ElevationFileProvider.GetFileSize()); }