Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
please give me a clear solution
Posted

try this CP article
Ienumrator with example
 
Share this answer
 
IEnumerator is an interface, which when implemented allows you to iterate through the list of controls. To implement it requires that you provide two methods - Reset to go back to the beginning of the list, and MoveNext to move forward, and Current to get the current item. MSDN provides an example here: http://msdn.microsoft.com/en-us/library/system.collections.ienumerator.aspx[^]
Once you have implemented IEnumerable for your class, it can become the target of a foreach loop, among other things.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 31-Oct-11 9:34am    
"... to iterate through the list of controls."

I'm not quite sure why/how a "list of controls" should be part of the picture here. :scratches head:
OriginalGriff 31-Oct-11 11:11am    
Because I can't spell "items"? That's my guess anyway...
In simple words Ienumerator is an iteration over a collection (non-generic). It is the base interface for enumerators. However, enumerators can be used to read data in a collection, and it cannot be used to modify the data in the collection. So you can think and example yourself to meet the above basic conditions. Give a try, and let us know if you are stuck.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900