Home All Groups Group Topic Archive Search About

Reflection: enumerating constants

Author
9 Nov 2006 10:13 PM
Jeff Johnson
I know how to get the fields, methods, properties, etc. from a type using
reflection. How do you get the constants?

Author
10 Nov 2006 5:46 AM
Mattias Sjögren
>I know how to get the fields, methods, properties, etc. from a type using
>reflection. How do you get the constants?

Since you know how to retrieve fields, you know how to retrieve
constants. Constants are static fields with FieldInfo.Literal = true.


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

AddThis Social Bookmark Button