Example #1
0
        private Func <T, T, int> ComparerCreator(Type type)
        {
            if (type == typeof(string))
            {
                var temp = new StringByLengthComparer <string>();
                comparer = temp.Compare;
                return(comparer);
            }

            if (type == typeof(int))
            {
                var temp = new StringByLengthComparer <string>();
                comparer = temp.Compare;
                return(comparer);
            }

            return(null);
        }
Example #2
0
        public string[] SortByTests(StringByLengthComparer <string> comp, string[] source)
        {
            Func <string, string, int> comparer = comp.Compare;

            return(source.SortBy(comparer).ToArray());
        }