新人求问 c#中this的用法
昨夜无月 2012-02-12 02:17:03 看书时书上习题答案的代码
public class ShortCollection<T>:IList<T>
{
protected Collection<T> innerCollection;
protected int maxSize = 10;
public ShortCollection()
: this(10)
{
}
public ShortCollection(int size)
{
maxSize = size;
innerCollection = new Collection<T>();
}
public ShortCollection(List<T> list)
: this(10, list)
{
}
那两个this时怎么个意思???
public T this[int index]
{
get
{
return (innerCollection as IList<T>)[index];
}
set
{
(innerCollection as IList<T>)[index] = value;
}
}
还有这个
实在理解不能 求指导