コード例 #1
0
        private IBusinessObjectCollection GetCollection(Type classType)
        {
            Type collectionType           = typeof(BusinessObjectCollection <>).MakeGenericType(classType);
            IBusinessObjectCollection col = (IBusinessObjectCollection)Activator.CreateInstance(collectionType);
            string criteria = String.Empty;
            string order    = String.Empty;

            try
            {
                var boll = this.BusinessObject.ClassDef.PropDefcol[this.PropertyName].LookupList as BusinessObjectLookupList;
                if (boll != null)
                {
                    criteria = boll.Criteria == null ? String.Empty : boll.Criteria.ToString();
                    order    = boll.OrderCriteria == null ? String.Empty : boll.OrderCriteria.ToString();
                }
            }
            catch (Exception) { }
            col.Load(criteria, order);
            //col.LoadAll();
            return(col);
        }