Possible duplicate:
Type.GetFields () - returns only public const fields.
I have a class that looks like this:
public class MyConstants { public const int ONE = 1; public const int TWO = 2; Type thisObject; public MyConstants() { thisObject = this.GetType(); } public void EnumerateConstants() { PropertyInfo[] thisObjectProperties = thisObject.GetProperties(BindingFlags.Public); foreach (PropertyInfo info in thisObjectProperties) {
Basquely, he tries to repulse himself. I know how to reflect ONE and TWO fields. But how do you know if it is constant or not?
deostroll
source share