摘要: List用起来比较方便,但是有时候要按照Index来访问List中的对象有些繁琐,所以想是不是扩展一下,既能按照Index来访问,又能按照Key访问。 实现方法: public class Person { public string Name { get; set; } public int Age { get; set; } } public class PersonCollecton : List { public Person this[string name] { get... 阅读全文
posted @ 2014-03-20 11:31 One Day 阅读(332) 评论(0) 推荐(0) 编辑