In which scenarios , Delegates are used?

Posted by Kulprachi84 under C# on 3/21/2012 | Points: 10 | Views : 1319 | Status : [Member] | Replies : 4
In which scenarios , Delegates are used?




Responses

Posted by: Sksamantaray on: 3/21/2012 [Member] Silver | Points: 25

Up
0
Down
Hi,
Refer to:
http://www.worldofasp.net/tut/prjDelegate/Delegates_173.aspx

Thanks,
Sanjay

Kulprachi84, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajni.Shekhar on: 3/21/2012 [Member] Bronze | Points: 25

Up
0
Down
delegates are used when you want to point a function. Actually delegates are function pointers.
You can use delegates with event also.

Thanks,
Rajni Shekhar

Kulprachi84, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Veerac85 on: 3/27/2012 [Member] Starter | Points: 25

Up
0
Down
There are just too many scenarios where we would need delegates

1) You could implement event handling using delegates
2) You could write anonymous methods using delegates
3) You could do asynchronous processing using delegates. Delegates can be used to define callback methods.
4) A class may need more than one implementation of the method.

if you would like to see & try out some examples to learn it's uses completely, you could visit following links
http://technico.qnownow.com/2012/03/27/delegates-in-c/
http://technico.qnownow.com/2012/03/27/event-handling-using-delegates-in-c/
http://technico.qnownow.com/2012/03/27/anonymous-methods-using-delegates-in-c/
http://technico.qnownow.com/2012/03/23/how-to-do-asynchronous-processing-using-delegates-in-c-wpf/

Regards
Veera

Kulprachi84, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response