Archive for December, 2007

Development Tools

Wednesday, December 26th, 2007

.NET Developer’s toolkit.
These are the list of tools I use in my everyday programming practice:

Hope this will be helpful.

Yield C# Keyword

Saturday, December 15th, 2007

Yield is a C# Language Feature.

Here is a description from a book: Professional .NET Framework 2.0, by Joe Duffy.

If you are interested in creating an IEnumerator<T>, C# provides a powerful and flexible iterator construct. To create an iterator, simply create a method that either returns either IEnumerable<T> (or just IEnumerable, the weakly typed equivalent) or IEnumerator<T>, and generates a sequence of values using the yield statement. The C# compiler will go ahead and create the underlying IEnumerator<T> type for you:

yield.gif

Rather than manually creating a new IEnumerator<T> class, the C# compiler does it for us. The result is an enumerator that calculates the next value each time a call to MoveNext is made, passing the next value and waiting to be called again via a call to yield. When the method returns, it indicates to the caller that they have reached the end of the collection.

Here is also another example:

yieldconstruction.gif