Skip to Main Content
Programming .NET Components, 2nd Edition
book

Programming .NET Components, 2nd Edition

by Juval Lowy
July 2005
Intermediate to advanced content levelIntermediate to advanced
644 pages
17h
English
O'Reilly Media, Inc.
Content preview from Programming .NET Components, 2nd Edition

Chapter 6. Events

In a component-oriented program, an object provides services to clients by letting clients invoke methods and set properties on the object. But what if a client (or more than one client, as shown in Figure 6-1) wants to be notified about an event that occurs on the object’s side? This situation is very common, and almost every application relies on some sort of event subscription and publishing mechanism.

A publishing object can fire events at multiple subscribing clients

Figure 6-1. A publishing object can fire events at multiple subscribing clients

Because events are actually nothing more than method calls, there is nothing inherently special about firing events, and therefore I have chosen not to consider event support as a core principle of component-oriented programming. However, that doesn’t mean that the component technology used should not try to ease the task of subscribing to and publishing events. Not surprisingly, .NET event support automates the process as much as possible. This chapter starts by describing the essential concepts of .NET event support and then provides a set of practical guidelines for effectively managing events and extending the basic event support.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows Forms Programming in C#

Windows Forms Programming in C#

Chris Sells
Metaprogramming in .NET

Metaprogramming in .NET

Jason Bock, Kevin Hazzard
.NET Windows Forms in a Nutshell

.NET Windows Forms in a Nutshell

Ian Griffiths, Matthew Adams

Publisher Resources

ISBN: 0596102070Supplemental ContentErrata Page