예제 #1
0
        private static int[] CustomSortDemo()
        {
            int[]      arr       = { 6, 5, 47, 8, 2, 4, 6, 2, 58, 5 };
            string[]   s         = { "asd", "hsdfgf", "asg", "ueot", "hello", "asd" };
            Sort <int> intSort   = CustomSort.CustomEqual;
            var        sortedInt = CustomSort.Sort(arr, intSort);

            Console.WriteLine("Int sorting in thread 1:" + Environment.NewLine);
            SortingThreat.Print(sortedInt);
            Sort <string> strSort   = CustomSort.CustomEqual;
            var           sortedStr = CustomSort.Sort(s, strSort);

            Console.WriteLine("String sorting in thread 1:" + Environment.NewLine);
            SortingThreat.Print(sortedStr);
            return(arr);
        }
예제 #2
0
        internal void SortStart()
        {
            Console.WriteLine();
            Done?.Invoke(this, new Thr2EventArgs("Thread 2 is Start"));
            Sort <string> s = CustomSort.CustomEqual;

            string[] mass = { "aabb", "aaab", "cbbb", "s0", "sfdsds6" };
            Console.WriteLine("String sorting in thread 2");
            Print(mass);
            var mass1 = CustomSort.Sort(mass, s);

            Console.WriteLine();
            Print(mass1);
            Console.WriteLine();
            Done?.Invoke(this, new Thr2EventArgs("Thread 2 is done"));
            Console.WriteLine("Press any key to close thread 2");
            Console.ReadKey();
            Console.WriteLine("Thread 2 was closed");
        }