Alsing.Design.FilteredTypeConverter.GetProperties C# (CSharp) 메소드

GetProperties() 공개 메소드

public GetProperties ( ITypeDescriptorContext context, object value, Attribute attributes ) : PropertyDescriptorCollection
context ITypeDescriptorContext
value object
attributes System.Attribute
리턴 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);
        }