Alsing.Design.FilteredTypeConverter.GetProperties C# (CSharp) Method

GetProperties() public method

public GetProperties ( ITypeDescriptorContext context, object value, Attribute attributes ) : PropertyDescriptorCollection
context ITypeDescriptorContext
value object
attributes System.Attribute
return System.ComponentModel.PropertyDescriptorCollection
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value,
                                                                   Attribute[] attributes)
        {
            PropertyDescriptorCollection propps = propps = TypeDescriptor.GetProperties(value, attributes, false);

            var arr = new Hashtable();
            foreach (PropertyDescriptor pd in propps)
                arr[pd.Name] = pd;

            FilterProperties(arr, value);

            //copy the modified propp arr into a typed propertydescriptor[] 
            var arr2 = new PropertyDescriptor[arr.Values.Count];
            arr.Values.CopyTo(arr2, 0);

            //return the new propertydescriptorcollection
            return new PropertyDescriptorCollection(arr2);
        }