Пример #1
0
 public static AutoTreeSortedList <T, TId, TSortKey> Create <TId, TSortKey>(
     SelectId <T, TId> selectId,
     SelectParentId <T, TId> selectParentId,
     IdComparer <TId> idComparer,
     SelectSortKey <T, TSortKey> selectSortKey,
     SortKeyComparer <TSortKey> sortKeyComparer) where TId : struct
 {
     return(new AutoTreeSortedList <T, TId, TSortKey>(
                selectId, selectParentId, idComparer, selectSortKey, sortKeyComparer));
 }
Пример #2
0
 public static GroupedTreeList <T, TId, TSortKey, TGroupKey> Create <TId, TSortKey, TGroupKey>(
     SelectId <T, TId> selectId,
     SelectParentId <T, TId> selectParentId,
     IdComparer <TId> idComparer,
     SelectSortKey <T, TSortKey> selectSortKey,
     SortKeyComparer <TSortKey> sortKeyComparer,
     SelectGroupKey <T, TGroupKey> selectGroupKey,
     GroupKeyComparer <TGroupKey> groupKeyComparer,
     IEnumerable <TGroupKey> groups,
     GroupedTreeSeparator separator) where TId : struct
 {
     return(new GroupedTreeList <T, TId, TSortKey, TGroupKey>(
                selectId, selectParentId, idComparer, selectSortKey, sortKeyComparer, selectGroupKey, groupKeyComparer, groups,
                separator));
 }
Пример #3
0
    public static void Main19()
    {
        string[]        values = { "able", "ångström", "apple", "Æble",
                                   "Windows",     "Visual Studio" };
        SortKeyComparer comparer = new SortKeyComparer();

        // Change thread to en-US.
        Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
        // Sort the array and copy it to a new array to preserve the order.
        Array.Sort(values, comparer);
        string[] enValues = (String[])values.Clone();

        // Change culture to Swedish (Sweden).
        Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("sv-SE");
        Array.Sort(values, comparer);
        string[] svValues = (String[])values.Clone();

        // Compare the sorted arrays.
        Console.WriteLine("{0,-8} {1,-15} {2,-15}\n", "Position", "en-US", "sv-SE");
        for (int ctr = 0; ctr <= values.GetUpperBound(0); ctr++)
        {
            Console.WriteLine("{0,-8} {1,-15} {2,-15}", ctr, enValues[ctr], svValues[ctr]);
        }
    }