Here is a VB-Solution - of course VB and not C# - but I normally work with VB.
But most of that, what is necessary for you, is .Net and should be easy converted to C# ...
Public Shared Function GetProperty(ByVal component As Object, ByVal propertyName As String) As Object
Try
Dim pd As System.ComponentModel.PropertyDescriptor = System.ComponentModel.TypeDescriptor.GetProperties(component)(propertyName)
Return pd.GetValue(component)
Catch
Return Nothing
End Try
End Function
Public Shared Function GetPropertyList(ByVal component As Object) As String()
Dim pis As System.Reflection.PropertyInfo() = component.GetType().GetProperties()
Dim myLen As Integer = pis.GetLength(0) - 1
Dim myArray(myLen) As String
For i As Integer = 0 To myLen
myArray(i) = pis(i).Name
Next
Return myArray
End Function
But it is in fact nothing else as the posted Solution of OriginalGriff ...