/// <summary>Compare 2 ArchivingLanguage objects. They are identical if they have the same Iso3Code and LanguageName</summary> public int CompareTo(object obj) { if (obj == null) { return(1); } ArchivingLanguage other = obj as ArchivingLanguage; if (other == null) { throw new ArgumentException(); } // first compare the Iso3Code int result = String.Compare(Iso3Code, other.Iso3Code, StringComparison.Ordinal); if (result != 0) { return(result); } // if the same Iso3Code, compare the LanguageName return(String.Compare(LanguageName, other.LanguageName, StringComparison.Ordinal)); }
/// <summary>Compare 2 LanguageString objects. They are identical if they have the same Iso3LanguageId</summary> public static int Compare(ArchivingLanguage langA, ArchivingLanguage langB) { return(langA.CompareTo(langB)); }