Getting all public constants from the main and nested classes
How about this:

private static IEnumerable&lt;FieldInfo&gt; GetPublicConstants(Type type)
{
    return GetPublicClassConstants(type)
        .Concat(type.GetNestedTypes(BindingFlags.Public).SelectMany(GetPublicConstants));
}

private static IEnumerable&lt;FieldInfo&gt; GetPublicClassConstants(Type type)
{
    return type
        .GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy)
        .Where(fi =&gt; fi.IsLiteral &amp;&amp; !fi.IsInitOnly);
}


OR, as I do enjoy playing PGA Pro Code Golf:

private static IEnumerable&lt;FieldInfo&gt; GetPublicConstants(Type type)
{
    return type
        .GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy)
        .Where(fi =&gt; fi.IsLiteral &amp;&amp; !fi.IsInitOnly)
        .Concat(type.GetNestedTypes(BindingFlags.Public).SelectMany(GetPublicConstants));
}