Beispiel #1
0
        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;
        }
Beispiel #2
0
        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);
            }
        }