internal static QHistory.Search Get(this List <QHistory.Search> h, string text) { for (int i = h.Count - 1; i >= 0; i--) { QHistory.Search s = h[i]; if (s.text == text) { return(s); } } return(null); }
static int CompareHistoryByDate(QHistory.Search a, QHistory.Search b) { if (a.date > b.date) { return(-1); } if (a.date < b.date) { return(1); } // Dates are equal, so now sort by name return(string.Compare(b.text, a.text, System.StringComparison.Ordinal)); }
static int CompareHistoryByCount(QHistory.Search a, QHistory.Search b) { if (a.count > b.count) { return(-1); } if (a.count < b.count) { return(1); } // Counts are equal, so now sort by name return(string.Compare(b.text, a.text, System.StringComparison.Ordinal)); }