O
Oskar Lundgren
I want to iterate over fields declared like this, using reflection
(and there are good reasons for that):
Protected WithEvents Foo1 As Bar
Protected WithEvents Foo2 As Bar
....
I use the following code to get an array containing the fields
(wrapped in PropertyInfo objects):
Dim objs As Object() =
Me.GetType().GetProperties(Reflection.BindingFlags.Instance Or
Reflection.BindingFlags.NonPublic)
My question is: How do I get the wrapped "Bar" objects (Foo1, Foo2 and
so on)out of the PropertyInfo objects, so I can make calls to the
methods of the "Bar" objects. Using GetValue on the PropertyInfo
objects does not work.
(and there are good reasons for that):
Protected WithEvents Foo1 As Bar
Protected WithEvents Foo2 As Bar
....
I use the following code to get an array containing the fields
(wrapped in PropertyInfo objects):
Dim objs As Object() =
Me.GetType().GetProperties(Reflection.BindingFlags.Instance Or
Reflection.BindingFlags.NonPublic)
My question is: How do I get the wrapped "Bar" objects (Foo1, Foo2 and
so on)out of the PropertyInfo objects, so I can make calls to the
methods of the "Bar" objects. Using GetValue on the PropertyInfo
objects does not work.