您的位置:首页 > 编程语言

对Dictionary操作 查找项和排序 [代码记录]

2008-02-22 16:45 281 查看
KeyCollection:

protected void Page_Load(object sender, EventArgs e)

internal class Employee

internal class EmployeeCollection : KeyedCollection<Int32, Employee>

GroupDictionary:

2 internal class GroupDictionary<T> : Dictionary<String, List<T>>

3 {

4 public void Add(String key, T value)

5 {

6 List<T> list = null;

7 if (!this.ContainsKey(key) || !(this.TryGetValue(key, out list)))

8 {

9 list = new List<T>();

10 this.Add(key, list);

11 }

12 list.Add(value);

13 }

14 }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: