
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
512
|
Chapter 9: Delegates, Events, and Anonymous Methods
This class passes the name of the logged-on user to the XxxListener methods to allow
them to determine whether the operation should continue based on that user’s privi-
leges. This is just one example of creating a specialized
EventArgs class. You can cre-
ate others to pass in whatever information your listeners need.
See Also
See Recipe 9.5; see the “Event Keyword,” “EventHandler Delegate,” and “Handling
and Raising Events” topics in the MSDN documentation.
9.7 An Advanced Interface Search Mechanism
Problem
You are searching for an interface using the Type class. However, complex interface
searches are not available through the
GetInterface and GetInterfaces methods of a
Type object. The GetInterface method searches for an interface only by name (using
a case-sensitive or case-insensitive search), and the
GetInterfaces method returns an
array of all the interfaces implemented on a particular type. You want a more
focused searching mechanism that might involve searching for interfaces that define
a method with a specific signature or implemented interfaces that are loaded from
the GAC. You need more flexible and more advanced searching for interfaces that
does not involve creating your own interface search engine. This capability