I'm not fully getting this IEnumerable<T> thing. Please give me some pointers.
First off - the code below is for a list of strings, but I just did that because it takes focus off any specific class I have.
I like having my own GetFirst/GetNext functions - but now I have no choice but to get into iterators with xaml.. But still want to mix the two (if possible). I understand that the GetEnumerator is the one that is used by loops as an automatic GetFirst/GetNext.
I don't understand the "Collections.IEnumerable.G
or" one though.... Why are there 2 types?
So my question is - can you please point out - with the example class I have below, what could I do with the "Collections.IEnumerable.G
or" function - where would I use it? And is there any way to use the GetNextWord() function in collaboration or as an alternative to what we get with GetEnumerator() in order to implement it?
Here's the simple class we can talk about:
public class MyStringList: IEnumerable<String>
private List<String> m_Strings new List<String>();
public IEnumerator<String> GetEnumerator()
public String GetNextString()