Thanks for your answer....
I think I will try a special case for enum...
Other converter can't be that stupid!
--
Regards,
Lloyd Dupont
NovaMind Software
Mind Mapping at its best
www.nova-mind.com
"Marc Gravell" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> If you look at KeysConverter in "reflector", and look at Initialize()
> and ConvertTo(), you'll see that it gets the values from
> SR.GetString(), which calls ResourceManager.GetString passing a "null"
> culture, which in turn causes the system to use the CurrentUICulture.
>
> So; perhaps you could take a memento of the current UI culture, make
> your call and swap back? something like (untested, where Test2 does
> the conversion):
>
> static readonly CultureInfo fixedCulture =
> CultureInfo.InvariantCulture;
> static void Test() {
> CultureInfo memento =
> Thread.CurrentThread.CurrentUICulture;
> if (memento == fixedCulture) {
> Test2();
> } else {
> try {
> Thread.CurrentThread.CurrentUICulture =
> fixedCulture;
> Test2();
> } finally {
> Thread.CurrentThread.CurrentUICulture = memento;
> }
> }
> }
>
> Also - note that TypeConverter can also be specified against an
> individual property (not just a type), and the conversion can be
> dependent on the instance. You may or may not wish to consider using
> ITypeDescriptorContext to give this information to the converter.
>
> Marc
>