110,537
社区成员
发帖
与我相关
我的任务
分享
public abstract class CollectionBase : IList, ICollection, IEnumerable
{
// Methods
protected CollectionBase();
public void Clear();
public IEnumerator GetEnumerator();
protected virtual void OnClear();
protected virtual void OnClearComplete();
protected virtual void OnInsert(int index, object value);
protected virtual void OnInsertComplete(int index, object value);
protected virtual void OnRemove(int index, object value);
protected virtual void OnRemoveComplete(int index, object value);
protected virtual void OnSet(int index, object oldValue, object newValue);
protected virtual void OnSetComplete(int index, object oldValue, object newValue);
protected virtual void OnValidate(object value);
public void RemoveAt(int index);
void ICollection.CopyTo(Array array, int index);
int IList.Add(object value); //***** 注意这里 ******
bool IList.Contains(object value);
int IList.IndexOf(object value);
void IList.Insert(int index, object value);
void IList.Remove(object value);
// Properties
public int Count { get; }
protected ArrayList InnerList { get; }
protected IList List { get; }
bool ICollection.IsSynchronized { get; }
object ICollection.SyncRoot { get; }
bool IList.IsFixedSize { get; }
bool IList.IsReadOnly { get; }
object IList.this[int index] { get; set; }
// Fields
private ArrayList list;
}
class a:CollectionBase
{
public int add(value0
{
return List.add(value)//这是接口的显示用法,但是必须要用接口的事例,其中List应该是上面定义的实例,想问
protected IList List { get; } 这个接口里面是怎么进行对CollectionBase 类进行实例的?
}
}
object IList.this[int index] { get; set; }