コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }