Hey, having trouble getting my head around delegates, can anyone have a bash at explaining them or pointing me to a decent tutorial.
I understand they can call many methods at runtime but I cannot think of a situation where you would need this other than in an Event.
Loading
Rajeswari nathanPosted Oct 12, 2009, 2:56 AM
This is the functional pointer...
(ie) you can create on method and point it using delegate..
Why Delegate?
1. We can not pass the method as parameter in to another method.
We can do it in delegate..
2. We can create our own events by using delegate...
Niradhip ChakrabortyPosted Oct 12, 2009, 2:02 AM
http://www.c-sharpcorner.com/UploadFile/niradhip/delegates109122009063813AM/delegates1.aspx
Kirtan PatelPosted Oct 11, 2009, 4:59 PM
1. Creating Custom Event ..
2. Cross threading Operations ( When you access Content of Another Thread From Running thread )
:)
TrinityPosted Oct 11, 2009, 4:54 PM
Imagine that you want to create your custom event, then you have to use delegate
Imagine that you want to only execute a code without having the obligation to create a class you use delegate to execute anonymous method
Imagine that you want to execute code in a separate thread then you use delegate there are many cases to use delegates
Roei BarPosted Oct 11, 2009, 8:32 AM
say you want to update a form via another form
cross form connection is not an available option, in order to do that you will need to use a delegate event for Updating information. something like a Cross Thread Safe Event Handling
Danatas GerviPosted Oct 11, 2009, 7:30 AM
:-)