C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...









Generics--- Using IEnumerable and yield


Posted Date: 13 May 2008    Resource Type: Code Snippets    Category: C# Syntax

Posted By: shakti singh tanwar       Member Level: Diamond
Rating:     Points: 10



public class CityCollection : IEnumerable
{
public IEnumerator GetEnumerator()
{
yield return "New York";
yield return "Paris";
yield return "London";
}

IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
Now you can create an object of CityColletion class and call GetEnumerator methon on it to get the items from collection.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Delete text file file
Previous Resource: How to print a page in ASP.Net
Return to Discussion Resource Index
Post New Resource
Category: C# Syntax


Post resources and earn money!
 
Related Resources



Read TATA Nano reviews.
dotNet Slackers   BizTalk Adaptors    Web Design   Scripts
Are you waiting for engineering entrance result? Watch here for engineering entrance results.
doors in nj

Contact Us    Privacy Policy    Terms Of Use