Hi.......
Ques: Hello all of you now i am work in delegate but i am not understand What are events and what is the difference between delegates and events? Please explain and give a example....
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Chintan RathodRank #516 · 4.8K reputationPosted Dec 28, 2011, 8:01 AM EST
http://www.ikriv.com/en/prog/info/dotnet/Delegates.html
Thank you.
Satyapriya NayakRank #47 · 31.5K reputationPosted Dec 28, 2011, 8:20 AM EST
Events
An event is the outcome of an action. There are two important terms with respect to events. The event source and the event receiver. The object that raises the event is called event source and the object that responds to the event is called event receiver. Did you observe a hitch in the above explanation? O.K. my event source raises the event and my event receiver receives it, but what is the communication channel between them. Take the instance of you talking with a friend of yours over the telephone. Now you are the event source and your friend is the event receiver and the telephone cable is the communication channel. Similarly the communication channel between an event source and an event receiver is the delegate. The internals of events and their relationship to delegates would be dealt with in a later article. The explanation of events here is just to help the reader understand and visualize what exactly events are.
Delegate is a class that can hold a reference to a method or a function.Delegate class has a signature and it can only reference those methods whose signature is compliant with the class.Delegates are type-safe functions pointers or callbacks.
Refer the below for more
http://www.codeproject.com/KB/cs/delegates-part1.aspx
Thanks
VulpesRank #55 · 29.2K reputationPosted Dec 28, 2011, 8:27 AM EST