Sunday, April 19, 2009

Delegates properties

  • Delegates are similar to C++ function pointers, but are type safe.
    Delegates allow methods to be passed as parameters.
    Delegates can be used to define callback methods.
    Delegates can be chained together; for example, multiple methods can be called on a single event.
    Methods don't need to match the delegate signature exactly.

C# version 2.0 introduces the concept of Anonymous methos, which permit code blocks to be passed as parameters in place of a separately defined method.

No comments:

Post a Comment