Re: How to get base data type for enum via reflection
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Tue, 27 Nov 2007 19:32:45 -0000
john conwell <johnconwell@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
in .Net you can make your Enum inherit from sbyte, byte, short, ushort, int,
uint, long, ulong (default is int).
What I'm trying to do is determine what is the underlying type of a enum at
runtime via reflection. But I cant figure out how. If I get the Type of my
custom emun, it's base type property just says System.Enum, who's base type
is System.Enum (and on and on...).
Is there anyway to figure this out?
Use Enum.GetUnderlyingType(Type)
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
.
- Prev by Date: Re: How to tell sql server the maximum size my temp table will grow so that it does at most 1 memory allocation?
- Next by Date: Re: Generic Collections
- Previous by thread: Re: How to tell sql server the maximum size my temp table will grow so that it does at most 1 memory allocation?
- Next by thread: Re: Generic Collections
- Index(es):
Relevant Pages
|
Loading