C#索引器及示例
public class IndexSeletor<T> where T:struct { private List<T> _listObj; public IndexSeletor(List<T> listParm) { this._listObj = listParm; } public T this[int index] { get { if (index >= 100) return _listObj[index]; else return default(T); } set { if (index >= 100) _listObj[index] =value; } } }