Is this a bug? Expected behavior? Did I get the binding flags wrong?
Bob
--------------------
Imports System.Reflecti on
Module Main
Public Sub main()
Dim b As BindingFlags = BindingFlags.No nPublic Or _
BindingFlags.Pu blic Or BindingFlags.In stance
GetProperties(G etType(foo), b)
GetProperties(G etType(foo2), b)
End Sub
Private Sub GetProperties(B yVal t As Type, ByVal b As BindingFlags)
Dim str As String
For Each p As PropertyInfo In t.GetProperties (b)
str &= p.Name & vbCrLf
Next
MsgBox(str)
End Sub
End Module
Public Class foo
Private _testpublic As String
Public Property testpublic() As String
Get
Return _testpublic
End Get
Set(ByVal Value As String)
_testpublic = Value
End Set
End Property
Private _testprivate As String
Private Property testprivate() As String
Get
Return _testprivate
End Get
Set(ByVal Value As String)
_testprivate = Value
End Set
End Property
End Class
Public Class foo2
Inherits foo
End Class