Click here to Skip to main content
15,914,943 members
Home / Discussions / C#
   

C#

 
QuestionSerialization Problem Pin
Kevin Marois24-May-10 13:00
professionalKevin Marois24-May-10 13:00 
AnswerRe: Serialization Problem Pin
William Winner24-May-10 13:07
William Winner24-May-10 13:07 
GeneralRe: Serialization Problem Pin
Kevin Marois24-May-10 13:08
professionalKevin Marois24-May-10 13:08 
GeneralRe: Serialization Problem Pin
William Winner24-May-10 13:10
William Winner24-May-10 13:10 
GeneralRe: Serialization Problem Pin
Kevin Marois24-May-10 13:13
professionalKevin Marois24-May-10 13:13 
GeneralRe: Serialization Problem Pin
Ravi Bhavnani24-May-10 14:35
professionalRavi Bhavnani24-May-10 14:35 
QuestionFtpWebRequest accepting a port number when UsePassive = true. Does this violate RFC 959? Pin
Alaric_24-May-10 8:47
professionalAlaric_24-May-10 8:47 
QuestionIterator, foreach, IEnumerable IEnumerator for a beginner :s Pin
bon_chan24-May-10 7:47
bon_chan24-May-10 7:47 
Hi all,

I am a beginner in C# and .Net

I have been reading the Wrox Visual C# 2008 book, and I don't understand and see the use of Iterators.
This might sound a bit dumb but I need to ask because I don't understand at all.

I had a look at MSDN but I am still feeling unhappy!

So here is what I have understood so far:

- foreach loop implements IEnumerable Interface
- You implement IEnumerable for a class member and IEnumerator for a class
- With yield keyword, you don't need to implement the members IEnumerable (Current, MoveNext(),...)

Is it correct?

And what is the use of Iterators? What is the difference with the foreach loop?
Could someone give me some insight please?

Bon_chan
AnswerRe: Iterator, foreach, IEnumerable IEnumerator for a beginner :s Pin
Luc Pattyn24-May-10 8:04
sitebuilderLuc Pattyn24-May-10 8:04 
AnswerRe: Iterator, foreach, IEnumerable IEnumerator for a beginner :s Pin
Abhinav S24-May-10 18:23
Abhinav S24-May-10 18:23 
GeneralRe: Iterator, foreach, IEnumerable IEnumerator for a beginner :s Pin
bon_chan25-May-10 4:48
bon_chan25-May-10 4:48 
Question2D Map collison help required Pin
venomation24-May-10 7:00
venomation24-May-10 7:00 
AnswerRe: 2D Map collison help required [modified] Pin
Alaric_24-May-10 8:55
professionalAlaric_24-May-10 8:55 
AnswerRe: 2D Map collison help required Pin
Alaric_24-May-10 9:07
professionalAlaric_24-May-10 9:07 
GeneralRe: 2D Map collison help required [modified] Pin
Alaric_25-May-10 4:48
professionalAlaric_25-May-10 4:48 
AnswerRe: 2D Map collison help required Pin
venomation26-May-10 5:59
venomation26-May-10 5:59 
QuestionMessage Removed Pin
24-May-10 3:30
Xpnctoc24-May-10 3:30 
AnswerRe: Form controls data binding sequence Pin
Luc Pattyn24-May-10 5:21
sitebuilderLuc Pattyn24-May-10 5:21 
GeneralRe: Form controls data binding sequence Pin
Xpnctoc24-May-10 5:30
Xpnctoc24-May-10 5:30 
GeneralRe: Form controls data binding sequence Pin
Luc Pattyn24-May-10 7:50
sitebuilderLuc Pattyn24-May-10 7:50 
GeneralRe: Form controls data binding sequence Pin
Xpnctoc24-May-10 8:00
Xpnctoc24-May-10 8:00 
GeneralRe: Form controls data binding sequence Pin
Luc Pattyn24-May-10 8:09
sitebuilderLuc Pattyn24-May-10 8:09 
GeneralRe: Form controls data binding sequence Pin
Xpnctoc24-May-10 8:15
Xpnctoc24-May-10 8:15 
QuestionVisual Studions 2005 and crystal reports 11.5 R2 Pin
krown24-May-10 2:56
krown24-May-10 2:56 
QuestionWhy am I recieving corrupt images? Pin
TimSWatson24-May-10 2:37
TimSWatson24-May-10 2:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.