public static PropertyDescriptorCollection GetListItemProperties(object list, PropertyDescriptor[] listAccessors) {
PropertyDescriptorCollection pdc;
if ((null == listAccessors) || (listAccessors.Length == 0)) {
pdc = GetListItemProperties(list);
}
else {
if (list is Type) {
pdc = GetListItemPropertiesByType(list as Type, listAccessors);
}
else {
object target = GetList(list);
if (target is ITypedList) {
pdc = (target as ITypedList).GetItemProperties(listAccessors);
}
else if (target is IEnumerable) {
pdc = GetListItemPropertiesByEnumerable(target as IEnumerable, listAccessors);
}
else {
pdc = GetListItemPropertiesByInstance(target, listAccessors, 0);
}
}
}
return pdc;
}