Exemple #1
0
 public virtual void Swap(int indexA, int indexB)
 {
     //bug: do we really need two enumerations to find the approprate links?
     Ring.IndexedLink link1 = _storage.FindAtIndex(indexA);
     Ring.IndexedLink link2 = _storage.FindAtIndex(indexB);
     _storage.SwapValues(link1, link2);
 }
Exemple #2
0
 public virtual void Remove(object value)
 {
     Ring.IndexedLink findResult = _storage.Find(value);
     if (findResult != null)
     {
         _storage.RemoveLink(findResult);
     }
 }
Exemple #3
0
 public virtual object this[int index] {
     get {
         return(_storage.FindAtIndex(index)
                .Value);
     }
     set {
         Ring.IndexedLink findResult = _storage.FindAtIndex(index);
         _storage.IncrementEditVersion();
         findResult.RingLink.Value = value;
     }
 }
Exemple #4
0
 public object FindLast(Predicate whereClause)
 {
     Ring.IndexedLink indexedLink = _storage.FindLast(whereClause);
     return((indexedLink == null) ? null : indexedLink.Value);
 }
Exemple #5
0
 public int IndexOf(object value)
 {
     Ring.IndexedLink findResult = _storage.Find(value);
     return((findResult == null) ? -1 : findResult.Index);
 }