Changeset 1096 for trunk/eraser6


Ignore:
Timestamp:
6/2/2009 10:03:23 AM (6 years ago)
Author:
lowjoel
Message:

Removed all the comparison/Equals mess with the explicit conversion operator.

Location:
trunk/eraser6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Manager/Language.cs

    r1092 r1096  
    9797            return lang.culture; 
    9898        } 
    99  
    100         public override bool Equals(object obj) 
    101         { 
    102             CultureInfo cultureInfo = obj as CultureInfo; 
    103             Language language = obj as Language; 
    104             if (cultureInfo != null) 
    105                 return Equals(cultureInfo); 
    106             else if (language != null) 
    107                 return Equals(language.culture); 
    108             return false; 
    109         } 
    110  
    111         public bool Equals(CultureInfo other) 
    112         { 
    113             return culture == other; 
    114         } 
    115  
    116         public static bool operator ==(Language language, CultureInfo culture) 
    117         { 
    118             return language.Equals(culture); 
    119         } 
    120  
    121         public static bool operator ==(CultureInfo culture, Language language) 
    122         { 
    123             return language.Equals(culture); 
    124         } 
    125  
    126         public static bool operator !=(Language language, CultureInfo culture) 
    127         { 
    128             return !language.Equals(culture); 
    129         } 
    130  
    131         public static bool operator !=(CultureInfo culture, Language language) 
    132         { 
    133             return !language.Equals(culture); 
    134         } 
    135  
     99         
    136100        public override int GetHashCode() 
    137101        { 
  • trunk/eraser6/Eraser/SettingsPanel.cs

    r1052 r1096  
    200200                defaultsList.Add(S._("User interface language")); 
    201201                foreach (Language lang in uiLanguage.Items) 
    202                     if (lang == CultureInfo.CurrentUICulture) 
     202                    if ((CultureInfo)lang == CultureInfo.CurrentUICulture) 
    203203                        uiLanguage.SelectedItem = lang; 
    204204            } 
Note: See TracChangeset for help on using the changeset viewer.