[Mono-list] Re: IConvertible and Enum

Andrei Zmievski andrei@ispi.net
Mon, 14 Jan 2002 09:30:51 -0600


On Mon, 14 Jan 2002, Derek Holden wrote:
> In short, I don't care either way. I say uncomment the IConvertible 
> declaration in the base types and have the methods just call the 
> System.Convert methods. The only thing I ask is you take a look at the EMCA 
> conversion chart and only allow those explicit conversions. Oh, and there's 
> also a helper function defined in System.Convert for the ToType method. So 
> in implementing 'object ToType (Type convesionType, IFormatProvider 
> provider)' in the base types, you can just return Convert.ToType (value, 
> conversionType, provider).

Thanks for the info. I was looking at Enum.cs yesterday and could not
figure out a way to obtain the current value. I see there are arrays for
names and values, so what how does one obtain current value when
Enum.VALUE is called?

-Andrei
* Marriage is not a word. It's a sentence. Life-long sentence. *