コード例 #1
0
ファイル: ModelObjectSet.cs プロジェクト: lulzzz/Nucleus
        /// <summary>
        /// Get a list of IDs of the final set of items contained within this set, consisting of all items in the base collection
        /// and any subsets (or all items in the model if 'All' is true) that pass all filters specified via the
        /// Filters property.
        /// </summary>
        public List <T> GetItemIDs <T>(IDMappingTable <Guid, T> idMap)
        {
            IList items  = GetItems();
            var   result = new List <T>(items.Count);

            foreach (ModelObject mObj in items)
            {
                T id = idMap.GetSecondID(mObj.GUID);
                result.Add(id);
            }
            return(result);
        }
コード例 #2
0
ファイル: ModelObjectSet.cs プロジェクト: lulzzz/Nucleus
        /// <summary>
        /// Get a list of IDs of the final set of items contained within this set, consisting of all items in the base collection
        /// and any subsets (or all items in the model if 'All' is true) that pass all filters specified via the
        /// Filters property.
        /// </summary>
        public List <T> GetItemIDs <T>(IDMappingTable <Guid, IList <T> > idMap)
        {
            IList items  = GetItems();
            var   result = new List <T>(items.Count);

            foreach (ModelObject mObj in items)
            {
                IList <T> ids = idMap.GetSecondID(mObj.GUID);
                if (ids != null)
                {
                    foreach (T id in ids)
                    {
                        result.Add(id);
                    }
                }
            }
            return(result);
        }