public bool Equals(WordFrequency obj) { if (obj == null) { return(false); } return(_word == obj.Word && _frequency == obj.Frequency); }
public int CompareTo(WordFrequency obj) { if (Equals(obj)) { return(0); } int byFrequencyCompare = _frequency.CompareTo(obj.Frequency) * -1; if (byFrequencyCompare != 0) { return(byFrequencyCompare); } return(_word.ToLowerInvariant().CompareTo(obj.Word.ToLowerInvariant())); }