Is yield return
a shortcut for implementing IEnumerable
and IEnumerator
?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes, it is.
You can find out a lot more about it in chapter 6 of my book, C# in Depth. Fortunately chapter 6 is available for free from Manning's web site.
I also have two other articles on the book's web site.
Feedback welcome.
回答2:
To add to the link-fest, Raymond Chen did a nice little series on C# iterators a few months ago:
- http://blogs.msdn.com/oldnewthing/archive/2008/08/12/8849519.aspx
- http://blogs.msdn.com/oldnewthing/archive/2008/08/13/8854601.aspx
- http://blogs.msdn.com/oldnewthing/archive/2008/08/14/8862242.aspx
- http://blogs.msdn.com/oldnewthing/archive/2008/08/15/8868267.aspx
回答3:
Yes. See the following for a starter
http://msdn.microsoft.com/en-us/library/dscyy5s0.aspx