且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

排序自定义类列表< T>

更新时间:2022-06-20 09:05:27

这样做的一个方法是使用代表

One way to do this is with a delegate

List<cTag> week = new List<cTag>();
// add some stuff to the list
// now sort
week.Sort(delegate(cTag c1, cTag c2) { return c1.date.CompareTo(c2.age); });