Events

From eqqon

Revision as of 21:20, 21 November 2007 by Henon (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Quick Facts about C# Events

  • Fireing an Event that has not been registered (==null) raises a NullReferenceException. (annoying)
  • Registering for the same event twice with the same delegate means that the delegate will be called twice.
  • A delegate that has been registered for the same event multiple times must also be unregistered multiple times.
  • Unregistering an event that has never been registered (using -= on a null event) has no effect.
  • There is no built-in mechanism for preventing event recursions. (see Preventing Recursive Events)