async Task OnSelected(SearchItem <TItem>?item) { lastSelectedItem = item; InputValue = item?.Text ?? ""; if (RecentRepository != null && item != null) { await RecentRepository.AddHit(item.Key); item.LastHit = DateTime.Now; } if (OnItemSelected.HasDelegate) { await OnItemSelected.InvokeAsync(item?.DataObject); } if (ClearAfterSelection) { ClearInputValue(); } else { Calculate(); } isOpen = false; }
public void RecentSongs() { int?maxSongsToProcess = null; recentSongs = new DynamicTableEntity[100]; var songRepository = new SongRepository(new Repository("log")); songRepository.Process(null, GetModificationDate, maxSongsToProcess); string entityType = "song"; var recentRepository = new RecentRepository(); recentRepository.DeleteByEntityType(entityType); foreach (DynamicTableEntity entity in recentSongs) { testContextInstance.WriteLine("{0}", entity.Timestamp); recentRepository.Add(entity, entityType); } }