/// <summary> /// Determines whether the specified object is equal to the current object. /// </summary> /// <param name="obj">The object to compare with the current object.</param> /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns> /// <stable>ICU 55</stable> public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null || !(obj is UiListItem)) { return(false); } UiListItem other = (UiListItem)obj; return(NameInDisplayLocale.Equals(other.NameInDisplayLocale) && NameInSelf.Equals(other.NameInSelf) && Minimized.Equals(other.Minimized) && Modified.Equals(other.Modified)); }
/// <summary> /// Return a list of information used to construct a UI list of locale names. /// </summary> /// <param name="localeSet">A list of locales to present in a UI list. The casing uses the settings in the <see cref="LocaleDisplayNames"/> instance.</param> /// <param name="inSelf"> /// If true, compares the nameInSelf, otherwise the nameInDisplayLocale. /// Set depending on which field (displayLocale vs self) is to show up in the UI. /// If both are to show up in the UI, then it should be the one used for the primary sort order. /// </param> /// <param name="collator">How to collate—should normally be <c>Collator.GetInstance(GetDisplayLocale())</c>.</param> /// <returns>An ordered list of <see cref="UiListItem"/>s.</returns> /// <exception cref="IllformedLocaleException">If any of the locales in localeSet are malformed.</exception> /// <draft>ICU4N 60</draft> public virtual IList <UiListItem> GetUiList(ISet <ULocale> localeSet, bool inSelf, CompareInfo collator) // ICU4N specific overload, since CompareInfo doesn't implement IComparer<string> { return(GetUiListCompareWholeItems(localeSet, UiListItem.GetComparer(collator, inSelf))); }
/// <summary> /// Return a list of information used to construct a UI list of locale names. /// </summary> /// <param name="localeSet">A list of locales to present in a UI list. The casing uses the settings in the <see cref="LocaleDisplayNames"/> instance.</param> /// <param name="inSelf"> /// If true, compares the nameInSelf, otherwise the nameInDisplayLocale. /// Set depending on which field (displayLocale vs self) is to show up in the UI. /// If both are to show up in the UI, then it should be the one used for the primary sort order. /// </param> /// <param name="collator">How to collate—should normally be <c>Collator.GetInstance(GetDisplayLocale())</c>.</param> /// <returns>An ordered list of <see cref="UiListItem"/>s.</returns> /// <exception cref="IllformedLocaleException">If any of the locales in localeSet are malformed.</exception> /// <stable>ICU 55</stable> public virtual IList <UiListItem> GetUiList(ISet <ULocale> localeSet, bool inSelf, IComparer <string> collator) // ICU4N specific - changed from IComparer<object> to IComparer<string> { return(GetUiListCompareWholeItems(localeSet, UiListItem.GetComparer(collator, inSelf))); }