Code below causes error in class definition line
.....Isolator<T>' does not implement interface member
'System.Collections.IEnumerable.GetEnumerator()'.
'Myapp.Isolator<T>.GetEnumerator()' cannot implement
'System.Collections.IEnumerable.GetEnumerator()' because it does not have
the matching return type of 'System.Collections.IEnumerator'.
I tried to change method signature to
public IEnumerator GetEnumerator()
bu this causes another error
....Isolator<T>' does not implement interface member
'System.Collections.Generic.IEnumerable<T>.GetEnum erator()'.
'Myapp.Isolator<T>.GetEnumerator()' cannot implement
'System.Collections.Generic.IEnumerable<T>.GetEnum erator()' because it does
not have the matching return type of
'System.Collections.Generic.IEnumerator<T>'.
How to make this code work ?
Andrus.
using System;
using System.Collections;
using System.Collections.Generic ;
public class Isolator<T: IEnumerable<T>
{
IEnumerable<Tinner;
public Isolator(IEnumerable<Tenumerable)
{
inner = enumerable;
}
public IEnumerator<TGetEnumerator()
{
ArrayList<Tlist = new ArrayList<T>();
foreach (object o in inner)
list.Add(o);
return list.GetEnumerator();
}
}