IEnumerable ,IEnumerator

public interface IEnumerator
{
bool MoveNext ();
object Current { get;}
void Reset ();
}
This interface just supports navigation across items -- Iteration


You can implement it across your objects as below...
class staff : IEnumerable
{
private Human[] employees = new Human[4];
public staff()
{
employees[0] = new Human("bob");
employees[1] = new Human("chris");
employees[2] = new Human("jennifer");
employees[3] = new Human("Brian");
}

public IEnumerator GetEnumerator()
{
return employees.GetEnumerator();
}
}
class Human
{
public string Name{get;set;}
public Human(string name)
{ Name = name; }
}




Here is navigation....
staff office = new staff();
foreach (Human h in office )
{
MessageBox.Show(h.Name);
}



public IEnumerator GetEnumerator()
{
// this can be replaced // return employees.GetEnumerator();
foreach (Human c in employees)
{
yield return c;
}
}