私は次のようなクラスを持っています
Public Class Foo
Private _Name As String
<ShowInDisplay()> _
Public Property Name() As String
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property
Private _Age As String
Public Property Age() As String
Get
Return _Age
End Get
Set(ByVal value As String)
_Age = value
End Set
End Property
Private _ContactNumber As String
<ShowInDisplay()> _
Public Property ContactNumber() As String
Get
Return _ContactNumber
End Get
Set(ByVal value As String)
_ContactNumber = value
End Set
End Property
End Class
特定の属性を持つプロパティのみで作業する必要があるだけです。例:ShowInDisplay
Public Sub DisplayOnlyPublic(ByVal Someobject As Foo)
For Each _Property As something In Someobject.Properties
If _Property.HasAttribute("ShowInDisplay") Then
Console.WriteLine(_Property.Name & "=" & _Property.value)
End If
Next
End Sub