Alex Rivera | Logout

Iterating over class properties

Asked 2009-02-21T02:30:16.490
17

I'm trying to iterate over the Color class' Color properties.

Unfortunately its not in a collection so its just a class with a bunch of static properties.

Does anyone know if its possible to iterate over a class' properties be it static or object based?

Edit
Report

1 Answer

2

You might also be interested in this code

http://blog.guymahieu.com/2006/07/11/deep-reflection-of-properties-propertyreflector/

It provides an easy way to set/get properties by name. If you look into GetBestMatchingProperty you'll find the iteration over properties, that is done the same way as been posted before Iterating over class properties

answered 2009-02-21T03:01:59.410

Your Answer