示例#1
0
        public IEnumerable <StoreItemControl> GetStoreItems()
        {
            List <StoreItemControl> list = new List <StoreItemControl>();

            foreach (var item in storeItems.GetAll())
            {
                list.Add(ViewConverter.CreateStoreItemControl(item));
            }
            return(list);
        }
示例#2
0
        public IEnumerable <StoreItemControl> GetStoreItems(params Predicate <StoreItemView>[] predicates)
        {
            List <StoreItemControl> list = new List <StoreItemControl>();

            foreach (var item in storeItems.GetAll())
            {
                var  itemView = ViewConverter.CreateStoreItemView(item);
                bool fined    = true;
                foreach (var pred in predicates)
                {
                    if (!pred(itemView))
                    {
                        fined = false;
                        break;
                    }
                }
                if (fined)
                {
                    list.Add(ViewConverter.CreateStoreItemControl(item));
                }
            }
            return(list);
        }