예제 #1
0
 public async Task ExecuteLoadNextItemsCommand()
 {   //additional load for Items collection
     try
     {
         if (FeedItem != null && FeedItem.Id != null)
         {   //just add X more additional items to the Items list
             var itemCountBeforeAdd = Items.Count();
             var oldImageFileName   = AllItems.First <RssEpisode>().ImageFileName;
             //get next X items, but not more than ItemCount
             await Task.Run(() =>
             {
                 for (var i = itemCountBeforeAdd; (i < (itemCountBeforeAdd + ListItemSize)) && (itemCountBeforeAdd + ListItemSize) < ItemCount; i++)
                 {
                     var item = AllItems[i];
                     if (!ShowEpisodeImages && item.ImageFileName != oldImageFileName)
                     {
                         ShowEpisodeImages = true;
                     }
                     Items.Add(item);
                 }
             });
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex);
     }
 }
예제 #2
0
        async Task ExecuteLoadInitialItemsCommand()
        {   //initial load and get whole list from database
            IsBusy = true;

            try
            {
                Items.Clear();
                ShowEpisodeImages = false;
                if (FeedItem != null && FeedItem.Id != null)
                {
                    AllItems = await DataStore.GetAllEpisodeItemsByFeedIdAsync(FeedItem.Id.Value);

                    ItemCount = AllItems.Count;
                    var oldImageFileName = AllItems.First <RssEpisode>().ImageFileName;
                    for (var i = 0; i < ListItemSize; i++)
                    {
                        var item = AllItems[i];
                        if (!ShowEpisodeImages && item.ImageFileName != oldImageFileName)
                        {
                            ShowEpisodeImages = true;
                        }
                        Items.Add(item);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
예제 #3
0
        public int GetDropDownId()
        {
            if (Name == "")
            {
                return(0);
            }

            return(AllItems.IndexOf(AllItems.First(x => x.Text == Department.ToString())));
        }
예제 #4
0
        public async Task UpdateIncubators(bool updateInventory)
        {
            if (!updateInventory && AllItems != null)
            {
                List <EggIncubator> incubators = AllItems.First(x => x.InventoryItemData.EggIncubators != null).InventoryItemData.EggIncubators.EggIncubator.ToList();

                Incubators = incubators;
            }
            else
            {
                await GetInventory();
            }
        }
예제 #5
0
 public Workflow GetActiveWorkflow(int checklistLayoutId)
 {
     return(AllItems.First(wf => wf.Active == true && wf.ChecklistLayoutId == checklistLayoutId));
 }