public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { PropertyDescriptorCollection props = typeConverter.GetProperties(context, value, attributes); PropertyDescriptor[] result = new PropertyDescriptor[props.Count]; for (int i = 0; i < props.Count; i++) { result[i] = new ReadOnlyDescriptor(props[i]); } return(new PropertyDescriptorCollection(result)); }
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) { PropertyDescriptorCollection props = TypeDescriptor.GetProperties(wrapObj, attributes); PropertyDescriptor[] result = new PropertyDescriptor[props.Count]; for (int i = 0; i < props.Count; i++) { result[i] = new ReadOnlyDescriptor(props[i]); } return(new PropertyDescriptorCollection(result)); }