For iterator pattern should be:
public IEnumerator<RadioStation> GetEnumerator()
{
//Use can switch to this internal collection if you do not want to transform
//return mStations.GetEnumerator();
//use this if you want to transform the object before rendering
foreach (var x in mStations)
{
yield return x;
}
}
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
Currently is wrong and throws StackOverflowException.
public IEnumerator<RadioStation> GetEnumerator()
{
return this.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
//Use can switch to this internal collection if you do not want to transform
//return mStations.GetEnumerator();
//use this if you want to transform the object before rendering
foreach (var x in Stations)
{
yield return x;
}
}
For iterator pattern should be:
Currently is wrong and throws StackOverflowException.