The easiest way to write an enumerator in C# is with the "yield return" pattern. For example.
public IEnumerator Example() {
yield return 1;
yield return 2;
}
This pattern will generate all of the enumerator code under the hood. This takes the decision out of your hands.