实现Ilist接口的类
类:
1
using System;2
using System.Collections;3

4
namespace Relaction.Collections5
{6
/// <summary>7
/// MyList 的摘要说明。8
/// </summary>9
public class MyList:IList10
{11
private ArrayList _list;12
public MyList()13
{14
_list = new ArrayList();15
}16
IList 成员82

83
ICollection 成员115

116
IEnumerable 成员124
}125
}
客户:
1
private void button8_Click(object sender, System.EventArgs e)2
{3
Relaction.Collections.MyList list = new Relaction.Collections.MyList();4
list.Add(1);5
list.Add(2);6
for(int i =0;i<list.Count;i++)7
{8
label1.Text += list[i].ToString();9
}10
}



浙公网安备 33010602011771号