Beispiel #1
0
 /// <summary>
 /// Creates a descending key comparer.
 /// </summary>
 /// <typeparam name="TKey">The type of key objects being compared.</typeparam>
 /// <param name="selector">The key selector. May not be <c>null</c>.</param>
 /// <param name="keyComparer">The key comparer. The returned comparer applies this key comparer in reverse. Defaults to <c>null</c>. If this is <c>null</c>, the default comparer is used.</param>
 /// <param name="allowNulls">A value indicating whether <c>null</c> values are passed to <paramref name="selector"/>. If <c>false</c>, then <c>null</c> values are considered less than any non-<c>null</c> values and are not passed to <paramref name="selector"/>.</param>
 /// <returns>A key comparer.</returns>
 public IFullComparer <T> OrderByDescending <TKey>(Func <T, TKey> selector, IComparer <TKey> keyComparer = null, bool allowNulls = false)
 {
     Contract.Requires(selector != null);
     Contract.Ensures(Contract.Result <IFullComparer <T> >() != null);
     return(Compare <T> .OrderByDescending(selector, keyComparer, allowNulls));
 }
Beispiel #2
0
 /// <summary>
 /// Gets the default comparer for this type.
 /// </summary>
 public IFullComparer <T> Default()
 {
     Contract.Ensures(Contract.Result <IFullComparer <T> >() != null);
     return(Compare <T> .Default());
 }