public static PropertyDescriptorCollection GetProperties(object component, bool noCustomTypeDesc) {
if (component == null) {
throw new ArgumentNullException("component");
}
if (!noCustomTypeDesc && component is ICustomTypeDescriptor) {
PropertyDescriptorCollection properties = ((ICustomTypeDescriptor)component).GetProperties();
return GetEntry(component, component.GetType()).FilterProperties(component, null, properties);
}
return GetProperties(component, null, (component is ICustomTypeDescriptor));
}