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); }
public string[] SortByTests(StringByLengthComparer <string> comp, string[] source) { Func <string, string, int> comparer = comp.Compare; return(source.SortBy(comparer).ToArray()); }