示例#1
0
 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);
 }
示例#2
0
        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));
        }
示例#3
0
        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));
        }