0
私はクラスのプロパティのリストを取得するためにGetPropertiesを使用しています。GetPropertiesを使用してクラスのプロパティのリストを取得した後、親プロパティのクラスタイプを取得するにはどうすればよいですか?
Dim properties As List(Of PropertyInfo) = objType.GetProperties(BindingFlags.Instance Or BindingFlags.Public).ToList()
For Each prop As PropertyInfo In properties
'how do I get the parent class type of the prop (level up in hierarchy from property's ReflectedType)?
Next
は、どのように私は、現在のプロパティのReflectedType
の親クラスの1レベルアップを得るのですか?このクラスは複数の親レベルを持つことができます。私は現在のプロパティのクラスのBaseType
を望んでいませんが、プロパティの階層内の次のレベルは、プロパティとしていくつかの層が深くなる可能性があるので、ReflectedType
です。