// [IComparable<LanguageItem>] /// <summary> /// Facilitates ordering of language items to match their order in a source language list. /// Quality value is given precendence (higher sorts before lower value), but where that is equal, /// we fallback on Ordinal (lower sorts before higher value). /// </summary> /// <param name="other"></param> /// <returns></returns> public int CompareTo(LanguageItem other) { return(Quality != other.Quality ? (Quality > other.Quality ? -1 : 1): Ordinal != other.Ordinal ? (Ordinal < other.Ordinal ? -1 : 1): string.Compare( LanguageTag != null ? LanguageTag.ToString() : "", other.LanguageTag != null ? other.LanguageTag.ToString() : "", true)); }
// [IComparable<ILanguageTag>] public int CompareTo(ILanguageTag other) { return(string.Compare(m_langtag, other.ToString(), true)); }
// [IEquatable<ILanguageTag>] public bool Equals(ILanguageTag other) { return(0 == string.Compare(m_langtag, other.ToString(), true)); }
// [IComparable<ILanguageTag>] /// <summary> /// CompareTo /// </summary> /// <param name="other"></param> /// <returns></returns> public int CompareTo(ILanguageTag other) { return(string.Compare(OriginalLanguageTag, other.ToString(), StringComparison.OrdinalIgnoreCase)); }
// [IEquatable<ILanguageTag>] /// <summary> /// Equals /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(ILanguageTag other) { return(0 == string.Compare(OriginalLanguageTag, other.ToString(), StringComparison.OrdinalIgnoreCase)); }