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
Sign In
Register
AdSense Revenue
Gifts
Active Members
Today
vipul
(176)
ANIL PANDEY
(141)
UltimateRengan
(140)
Last 7 Days
UltimateRengan
(844)
D.Jeya kumar(J...
(745)
Athira Appukut...
(661)
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
Sign In
(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
Retrieving data from ArrayList with Objects
Generating gridview in runtime
How to find size of an image?
create a directory in C#.net
How to dynamically load view at runtime in SCSF & CAB
dotNet Slackers
BizTalk Adaptors
Web Design
it outsourcing
Contact Us
Privacy Policy
Terms Of Use