3
using System.Collections;
4
using System.Collections.Generic;
8
public class OrderedCollection<T> : ICollection<T> where T : System.IComparable<T>
10
private List<T> _collection = new List<T>();
12
public OrderedCollection()
16
public void Add (T item)
18
_collection.Add(item);
28
public bool Contains (T item)
30
return _collection.Contains(item);
34
public void CopyTo (T[] array, int arrayIndex)
36
_collection.CopyTo(array, arrayIndex);
39
public bool Remove (T item)
41
bool result = _collection.Remove(item);
48
return _collection.Count;
52
public bool IsReadOnly
60
public IEnumerator<T> GetEnumerator ()
62
return _collection.GetEnumerator();
65
IEnumerator IEnumerable.GetEnumerator ()
67
return GetEnumerator();