Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 反射类型与类型描述符_C#_Reflection_Typedescriptor - Fatal编程技术网

C# 反射类型与类型描述符

C# 反射类型与类型描述符,c#,reflection,typedescriptor,C#,Reflection,Typedescriptor,最近我在我的项目中使用了反射,我现在有一个问题 在Type.GetProperties(Flags)中,我们可以使用“Flags”过滤得到的属性;在TypeDescriptor.GetProperties()中,我们没有 在type.GetProperties中,我可以筛选以仅获取未继承的属性。 是否可以对TypeDescriptor.GetProperties()执行相同的操作(仅限未继承的属性) 谢谢不,不行 TypeDescriptor.GetProperties()用于获取Propert

最近我在我的项目中使用了反射,我现在有一个问题

Type.GetProperties(Flags)
中,我们可以使用“Flags”过滤得到的属性;在
TypeDescriptor.GetProperties()
中,我们没有

type.GetProperties
中,我可以筛选以仅获取未继承的属性。 是否可以对
TypeDescriptor.GetProperties()
执行相同的操作(仅限未继承的属性)

谢谢

不,不行

TypeDescriptor.GetProperties()
用于获取
PropertyDescriptor
实例,可以使用特定的
属性进行筛选

Type.GetProperties()
用于获取
PropertyInfo
实例,可以使用特定的
BindingFlags进行筛选

另请参见