Example #1
0
        public static async Task <Boolean> DeleteFiles(String _tripName, List <TripSummary> _listSummary, Boolean _save)
        {
            if (_listSummary == null)
            {
                _listSummary = await TripSummary.Load();
            }

            try
            {
                foreach (TripSummary _summary in _listSummary)
                {
                    if (_summary.Id.Equals(_tripName))
                    {
                        _listSummary.Remove(_summary);
                        break;
                    }
                }

                if (_save)
                {
                    await TripSummary.Save(_listSummary);
                }

                StorageFile fileDelete = await ApplicationData.Current.LocalFolder.GetFileAsync(_tripName + ".trip");

                await fileDelete.DeleteAsync(StorageDeleteOption.PermanentDelete);

                StorageFolder folderDelete = await ApplicationData.Current.LocalFolder.GetFolderAsync(_tripName);

                await folderDelete.DeleteAsync(StorageDeleteOption.PermanentDelete);

                return(true);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
                return(false);
            }
        }
Example #2
0
 public async Task SaveSummary()
 {
     await TripSummary.Save(_listSummary);
 }