bring Mono Security to monotouch
[mcs.git] / tests / gtest-247.cs
blob28260d85112ad0646ad7dde163d76aef9b973f33
1 using System;
2 using System.Diagnostics;
3 using SCG = System.Collections.Generic;
5 public abstract class EnumerableBase<T> : SCG.IEnumerable<T>
7 public abstract SCG.IEnumerator<T> GetEnumerator ();
9 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
11 return GetEnumerator ();
15 public abstract class CollectionValueBase<T> : EnumerableBase<T>
17 protected virtual void raiseItemsAdded (T item, int count)
18 { }
20 protected class RaiseForRemoveAllHandler
22 CircularQueue<T> wasRemoved;
25 public override abstract SCG.IEnumerator<T> GetEnumerator();
28 public class CircularQueue<T> : EnumerableBase<T>
30 public override SCG.IEnumerator<T> GetEnumerator()
32 yield break;
35 public virtual void Enqueue (T item)
36 { }
39 public class HashSet<T> : CollectionValueBase<T>
41 private bool searchoradd (ref T item, bool add, bool update, bool raise)
43 return true;
46 public virtual void RemoveAll<U>(SCG.IEnumerable<U> items) where U : T
48 RaiseForRemoveAllHandler raiseHandler = new RaiseForRemoveAllHandler ();
51 public virtual void AddAll<U> (SCG.IEnumerable<U> items)
52 where U : T
54 CircularQueue<T> wasAdded = new CircularQueue<T> ();
56 foreach (T item in wasAdded)
57 raiseItemsAdded (item, 1);
60 public override SCG.IEnumerator<T> GetEnumerator()
62 yield break;
66 class X
68 static void Main ()
69 { }