public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
            PropertyDescriptorCollection descriptors = new PropertyDescriptorCollection(new PropertyDescriptor[0]);
            TypeConverter converter = TypeDescriptor.GetConverter(value.GetType());

            if (((converter != null) && (converter.GetType() != base.GetType())) && converter.GetPropertiesSupported())
            {
                return(converter.GetProperties(context, value, attributes));
            }
            IComponent component = PropertyDescriptorUtils.GetComponent(context);

            if (component != null)
            {
                descriptors = PropertyDescriptorFilter.FilterProperties(component.Site, value, TypeDescriptor.GetProperties(value, new Attribute[] { BrowsableAttribute.Yes }));
            }
            return(descriptors);
        }
Example #2
0
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
            PropertyDescriptorCollection props = new PropertyDescriptorCollection(new PropertyDescriptor[] { });

            TypeConverter typeConverter = TypeDescriptor.GetConverter(value.GetType());

            if (typeConverter != null && typeConverter.GetType() != GetType() && typeConverter.GetPropertiesSupported())
            {
                return(typeConverter.GetProperties(context, value, attributes));
            }
            else
            {
                IComponent component = PropertyDescriptorUtils.GetComponent(context);
                if (component != null)
                {
                    props = PropertyDescriptorFilter.FilterProperties(component.Site, value, TypeDescriptor.GetProperties(value, new Attribute[] { BrowsableAttribute.Yes }));
                }
            }

            return(props);
        }