摘要: SortedList,SortedSet与SortedDictionary都是我们常用的泛型类型。当T是我们自定义的类型时,往往该类型的默认比较行为不是我们所期望的。例如,我们有如下很老土的Employee类: class Employee { publicint Id { get; set; } public String Name { get; set; } publicint Age { get; set; } }如果我们想让Employee类型按照Name字段升序排序,一般有两种做法。一种是让Employee实现IComparable或者ICo... 阅读全文
posted @ 2011-07-21 08:03 Roy Cheng 阅读(2525) 评论(5) 推荐(8) 编辑