Chapter 17. Interrupting Program Flow and Handling Events

After completing this chapter, you will be able to:

  • Declare a delegate type to create an abstraction of a method signature.

  • Create an instance of a delegate to refer to a specific method.

  • Call a method through a delegate.

  • Define a lambda expression to specify the code for a delegate.

  • Declare an event field.

  • Handle an event by using a delegate.

  • Raise an event.

Much of the code you have written in the various exercises in this book has assumed that statements execute sequentially. Although this is a common scenario, you will find that it is sometimes necessary to interrupt the current flow of execution and perform another, more important, task. When the task has completed, the program can continue ...

Get Microsoft® Visual C#® 2010 Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.