49 lines
931 B
C#
49 lines
931 B
C#
using System.Collections;
|
|
|
|
namespace Profiles
|
|
{
|
|
abstract class IList<T> : IEnumerable<T>
|
|
{
|
|
protected T[] list;
|
|
|
|
public int Length
|
|
{
|
|
get
|
|
{
|
|
return list.Length;
|
|
}
|
|
}
|
|
|
|
public T this[int index]
|
|
{
|
|
get
|
|
{
|
|
return list[index];
|
|
}
|
|
}
|
|
|
|
public IList()
|
|
{
|
|
this.list = new T[0];
|
|
}
|
|
|
|
public abstract void Add(T item);
|
|
public abstract void Remove(T item);
|
|
public abstract T SearchByName(string name);
|
|
public void Clear()
|
|
{
|
|
list = new T[0];
|
|
}
|
|
|
|
public IEnumerator<T> GetEnumerator()
|
|
{
|
|
return ((IEnumerable<T>)list).GetEnumerator();
|
|
}
|
|
|
|
IEnumerator IEnumerable.GetEnumerator()
|
|
{
|
|
return list.GetEnumerator();
|
|
}
|
|
}
|
|
}
|