Last post Feb 24, 2006 11:48 AM by rmprimo
Feb 24, 2006 11:48 AM|rmprimo|LINK
Here is complete low down with many undocumented goodies:
some additional little tidbits.
The CultureInfo.Equals method has now been changed in v2.0. It is no longer based on LCID. The IDE does not warn of that though, since it is not depricated.
So do not use LCID if you are creating a db of cultures.
CultureInfo which IMO should have been a struct, but it is not, may return unexpected results when comparing instances.
The == operator is not overloaded either.
CultureInfo ci1=new CuiltureInfo("en-US");
CultureInfo ci2=new CuiltureInfo("en-US");
What do you expect Response.Write((ci1==ci2).ToString()); would print out?
What about Response.Write(ci1.Equals(ci2).ToString()); ?
So use the Equals method only.
Also poor support for generics. IComparable<CultureInfo>.CompareTo and IEquatable<CultureInfo>.Equals are not implemented. So it is confined to non-generic collections code. It is not abstract, but deriving from it in practice can create a
whole bunch of new issues since so many controls use CultureInfo and not the descendant TweakedCultureInfo.