public async Task<Box> FindBox(QRCodeWrapper oQRCode) { CurrentBox = Boxes.FirstOrDefault(oBox => oBox.QRCode == oQRCode); if (CurrentBox == null) { CurrentBox = new Box(this, oQRCode); await MoveFolder.CreateFolderAsync(CurrentBox.ImageFolder); Boxes.Add(CurrentBox); } return CurrentBox; }
public async void LoadFolders() { CurrentBox = null; Boxes.Clear(); IReadOnlyList<StorageFolder> oFolders = await MoveFolder.GetFoldersAsync(); foreach (StorageFolder oFolder in oFolders) { //If a QR code has no images associated, we kill the folder if ((await oFolder.GetFilesAsync()).Count == 0) await oFolder.DeleteAsync(); else Boxes.Add(new Box(this, new QRCodeWrapper(oFolder))); } }