[Mono-bugs] [Bug 34192][Wis] Changed - Implementations for CultureInfo.Equals and CultureInfo.GetHashCode

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
18 Nov 2002 12:47:49 -0000


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by carlosga@telefonica.net.

http://bugzilla.ximian.com/show_bug.cgi?id=34192

--- shadow/34192	Mon Nov 18 07:00:34 2002
+++ shadow/34192.tmp.14135	Mon Nov 18 07:47:49 2002
@@ -2,13 +2,13 @@
 Product: Mono/Class Libraries
 Version: unspecified
 OS: All
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Wishlist
 Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: carlosga@telefonica.net               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -19,11 +19,50 @@
 Hello:
 
 I´m trying to use the ResourceManager.GetString method this methods needs
 implementations for CultureInfo.Equals and CultureInfo.GetHashCode, that
 are not implemented yect and raises an exception.
 
+
+
+Best regards
+Carlos Guzmán Álvarez
+Vigo-Spain
+
+------- Additional Comments From carlosga@telefonica.net  2002-11-18 07:47 -------
+Hello:
+
+> System.Globalization.CultureInfo.Equals 
+
+I made a little implementation for this but i´m not sure if it´s
+correct or not:
+
+
+public override bool Equals(object value)
+{
+    if (!(value is CultureInfo))
+        return false;
+
+    CultureInfo ci = (values as CultureInfo);
+
+    return    (ci.Calendar == this.Calendar        &&
+    ci.CompareInfo == this.CompareInfo        &&
+    ci.DateTimeFormat == this.DateTimeFormat    &&
+    ci.DisplayName == this.DisplayName        &&
+    ci.EnglishName == this.EnglishName        &&
+    ci.IsNeutralCulture == this.IsNeutralCulture    &&
+    ci.IsReadOnly == this.IsReadOnly        &&
+    ci.Name == this.Name                &&
+    ci.NativeName == this.NativeName        &&
+    ci.NumberFormat == this.NumberFormat        &&
+    ci.OptionalCalendars == this.OptionalCalendars    &&
+    ci.TextInfo == this.TextInfo            &&
+    ci.ThreeLetterISOLanguageName == this.ThreeLetterISOLanguageName &&
+    ci.ThreeLetterWindowsLanguageName ==
+this.ThreeLetterWindowsLanguageName &&
+    ci.TwoLetterISOLanguageName == this.TwoLetterISOLanguageName &&
+    ci.UseUserOverride == this.UseUserOverride);                }
 
 
 Best regards
 Carlos Guzmán Álvarez
 Vigo-Spain