Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delegate explanation
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00649150
Message ID:
00649790
Views:
17
>I was hoping someone here could give me a good explanation of delegates and why I want to use them.

Consider a situation where you have some type of server that is raising events. You write a client that wants to be notified when a server event fires (you want to subscribe an event list maintained by an event publisher). The way you do this is to give the event publisher (the server) the name of a client method to call when a server event fires. Delegates are the OOP way of doing this. When a server event fires, it will go through its event list and invoke any methods in the event list. Therefore, the method must have a well defined parameter list. The server doesn't care what the method does and wouldn't know what to do with a return value, so the method must be declared void.

HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform