示例#1
0
 /// <summary>
 /// Converts a single value into a sorted list containing a single value. The list is treated as though it were sorted by the default comparison object.
 /// </summary>
 /// <typeparam name="T">The type of the value.</typeparam>
 /// <param name="source">The value.</param>
 /// <returns>A sorted list containing a single element, <paramref name="source"/>.</returns>
 public static ISortedList <T> Return <T>(T source)
 {
     return(new SortedListWrapper <T>(ListSource.Return(source), Comparer <T> .Default));
 }
示例#2
0
 /// <summary>
 /// Converts a single value into a sorted list containing a single value. The list is treated as though it were sorted by the specified comparison delegate.
 /// </summary>
 /// <typeparam name="T">The type of the value.</typeparam>
 /// <param name="source">The value.</param>
 /// <param name="comparer">The comparison delegate that defines how the list is sorted.</param>
 /// <returns>A sorted list containing a single element, <paramref name="source"/>.</returns>
 public static ISortedList <T> Return <T>(T source, Func <T, T, int> comparer)
 {
     return(new SortedListWrapper <T>(ListSource.Return(source), A.Comparer(comparer)));
 }
示例#3
0
 /// <summary>
 /// Converts a single value into a sorted list containing a single value. The list is treated as though it were sorted by the specified comparison object.
 /// </summary>
 /// <typeparam name="T">The type of the value.</typeparam>
 /// <param name="source">The value.</param>
 /// <param name="comparer">The comparison object that defines how the list is sorted.</param>
 /// <returns>A sorted list containing a single element, <paramref name="source"/>.</returns>
 public static ISortedList <T> Return <T>(T source, IComparer <T> comparer)
 {
     return(new SortedListWrapper <T>(ListSource.Return(source), comparer));
 }