public ItemFilter ToItemFilter()
        {
            var items = this.ItemsList
                        .Where(sic => sic.IsSelected != false)
                        .SelectMany(sic => sic.Items.Where(sii => sii.IsSelected == true))
                        .Select(sii => sii.Value);

            ItemIDMask im = null;

            if (items.Any())
            {
                im = new ItemIDMask(items);
            }

            ItemCategoryMask icm = null;
            //if (itemCats.Any())
            //	icm = new ItemCategoryMask(itemCats);

            MaterialIDMask mim = null;
            //if (this.MaterialIDs.Any())
            //	mim = new MaterialIDMask(this.MaterialIDs);

            MaterialCategoryMask mcm = null;

            //if (this.MaterialCategories.Any())
            //	mcm = new MaterialCategoryMask(this.MaterialCategories);

            return(new ItemFilter(im, icm, mim, mcm));
        }
示例#2
0
        public ItemFilter(ItemIDMask itemIDMask, ItemCategoryMask itemCategoryMask,
			MaterialIDMask materialIDMask, MaterialCategoryMask materialCategoryMask)
        {
            m_itemIDMask = itemIDMask;
            m_itemCategoryMask = itemCategoryMask;
            m_materialIDMask = materialIDMask;
            m_materialCategoryMask = materialCategoryMask;
        }