考虑以下代码。
Object obj;
PropertyDescriptorCollection A = TypeDescriptor.GetProperties(obj);
PropertyInfo[] B = obj.GetType().GetProperties();
我试图了解 A 和 B 之间的区别。据我了解,TypeDescriptor.GetProperties()将返回自定义TypeDescriptor属性,而Type.GetProperties()将仅返回对象的内在“真实”属性。这是正确的吗?如果 obj 没有任何自定义TypeDescriptor属性,那么它只是默认返回对象的字面内在属性。