Пример #1
0
        /// <summary>
        /// 获取采集器集合
        /// </summary>
        /// <returns></returns>
        public List <IPicker> GetPickerList()
        {
            List <Type>    list       = LotteryHelper.GetTypeList(this._lotteryType);
            List <IPicker> pickerList = new List <IPicker>();

            foreach (Type type in list)
            {
                try
                {
                    IPicker picker = Activator.CreateInstance(type) as IPicker;
                    if (picker != null && picker.IsValid)
                    {
                        pickerList.Add(picker);
                    }
                }
                catch (Exception ex)
                {
                }
            }

            return(pickerList);
        }
Пример #2
0
        /// <summary>
        /// 获取采集器
        /// </summary>
        /// <param name="dataSource"></param>
        /// <returns></returns>
        public IPicker GetPicker(string dataSource)
        {
            List <Type> list = LotteryHelper.GetTypeList(this._lotteryType);

            foreach (Type type in list)
            {
                try
                {
                    IPicker picker = Activator.CreateInstance(type) as IPicker;
                    if (picker != null && type.Name.ToLower().Contains(dataSource.ToLower()))
                    {
                        return(picker);
                    }
                }
                catch (Exception ex)
                {
                    return(null);
                }
            }

            return(null);
        }