示例#1
0
        public IDataSourceFieldSchema[] GetFields()
        {
            List <ObjectFieldInfo> result = new List <ObjectFieldInfo>();
            Type t = DothanDataSource.GetType(
                _typeAssemblyName, _typeName);

            if (typeof(IEnumerable).IsAssignableFrom(t))
            {
                // this is a list so get the item type
                t = Utilities.GetChildItemType(t);
            }
            PropertyDescriptorCollection props = TypeDescriptor.GetProperties(t);

            foreach (PropertyDescriptor item in props)
            {
                if (item.IsBrowsable)
                {
                    result.Add(new ObjectFieldInfo(item));
                }
            }
            return(result.ToArray());
        }
 public override void Initialize(IComponent component)
 {
     base.Initialize(component);
     _control = (DothanDataSource)component;
 }