public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
            Type type = value.GetType();
            FieldInfo[] fields = type.GetFields();

            PropertyDescriptor[] props = new PropertyDescriptor[fields.Length];

            for (int i = 0; i < props.Length; i++)
                props[i] = new SettingPropertyDescriptor(fields[i]);
            return new PropertyDescriptorCollection(props);
        }
示例#2
0
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
            Type type = value.GetType();

            FieldInfo[] fields = type.GetFields();

            PropertyDescriptor[] props = new PropertyDescriptor[fields.Length];

            for (int i = 0; i < props.Length; i++)
            {
                props[i] = new SettingPropertyDescriptor(fields[i]);
            }
            return(new PropertyDescriptorCollection(props));
        }