public static async Task <CameraFileEntry[]> GetAllFiles() { CameraFileEntry rootFileEntry = await MainCamera.GetAllEntries(); CameraFileEntry[] fileEntries = GetAllFilesFromFolderOrVolume(rootFileEntry); return(fileEntries); }
public static CameraFileEntry[] GetAllFilesFromFolderOrVolume(CameraFileEntry fileEntry) { List <CameraFileEntry> fileEntries = new List <CameraFileEntry>(); if (!fileEntry.IsFolder && !fileEntry.IsVolume) { fileEntries.Add(fileEntry); return(fileEntries.ToArray()); } if (fileEntry.Entries != null) { foreach (CameraFileEntry subFileEntry in fileEntry.Entries) { fileEntries.AddRange(GetAllFilesFromFolderOrVolume(subFileEntry)); } } return(fileEntries.ToArray()); }
public static async Task DeleteLastCapturedFile() { LogMessage("Deleting last captured file"); if (LastCapturedFileInfo == null) { LogMessage("No reference to last captured file"); return; } CameraFileEntry lastCaptureFileEntry = await GetLastCapturedFileEntry(); LogMessage($"Last captured file \"{lastCaptureFileEntry.Name}\""); CameraFileEntry[] filesToDelete = { lastCaptureFileEntry }; await MainCamera.DeleteFiles(filesToDelete); LastCapturedFileInfo = null; LogMessage($"Last captured file \"{lastCaptureFileEntry.Name}\" deleted"); }