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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Dec 28, 2011, 1:27 PM
Satyapriya NayakPosted Dec 28, 2011, 1:20 PM
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
Chintan RathodPosted Dec 28, 2011, 1:01 PM
http://www.ikriv.com/en/prog/info/dotnet/Delegates.html
Thank you.