public class SafetyEnumerable<T> : IEnumerable<T>
{
// Fields
private readonly IEnumerable<T> collection;
// Methods
public SafetyEnumerable(IEnumerable<T> collection)
{
this.collection = collection;
}
IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
return collection.GetEnumerator();
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return collection.GetEnumerator();
}
}
|