A
Arne Garvander
How can get all the objects/data member in a class thru reflection.
How can get all the objects/data member in a class thru reflection.
How can get all the objects/data member in a class thru reflection.
[email protected] said:How can get all the objects/data member in a class thru reflection.
Assuming i understand your question correctly, if you have already
done:
MyClass myClass = new MyClass();
Then to get a list of properties in MyClass:
PropertyInfo[] propertyInfo = myClass.GetType().GetProperties();
To get a list of methods:
MethodInfo[] methodInfo = myClass.GetType().GetMethods();
Arne Garvander said:My class has 20 public variables. None of them showed up in GetProperties,
as
far as I can see.
My class has 20 public variables. None of them showed up in GetProperties, as
far as I can see.