LINQ in Action roller

Use a Lambda Expression for an Event Handler

You can use lambda expressions to write an event handler, even for classes that predate C# 3.0 and the latest version of the framework. This can shorten your code, and make it easier to read. For example, the code to validate an XML tree using an XSD schema takes an event handler because it may return multiple errors or warnings for a single validation pass. An easy way to write this code is as follows: using System; using System.Linq; using System.Collections.Generic; using System.IO; using System.Xml; Read More...
Published Tuesday, August 19, 2008 5:25 AM by Eric White's Blog
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication