Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Actually i don't no what is delegates, and where to use delegates ?

could any one in this group tell me about delegates and at what situation delegates to be used ?
Posted
Updated 7-May-15 19:54pm
v2
Comments
Florian Braun 8-May-15 1:47am    
The concept of delegates can be compared to function pointers in c. By using delegates you can have callback functions for async methods.. I strongly suggest to search for the specific articles here on codeproject or for tutorials using google
Sergey Alexandrovich Kryukov 8-May-15 2:04am    
The question does not make sense. Advantages — compared to what? If you don't know what to compare with, you cannot discuss "advantages". This is the same as asking "what are the advantages of functions?". Just learn the topics and you will know where to use delegates.
Situation? As it was one situation... Delegates are just everywhere. Learn the technology, instead of asking pointless questions. This is my advice.
—SA

If you know nothing about delegates, why don't you read about that?

Start here:
Delegates (C# Programming Guide)[^]
Delegates Tutorial[^]
 
Share this answer
 
v2
Comments
CPallini 8-May-15 2:41am    
5.
Maciej Los 8-May-15 2:42am    
Thank you, Carlo ;)
1)In general the delegate let you defines methods signatures and then to use them via properties or methods parameters. This could be use in communication between different classes;

For details about this see the next article: 6 important uses of Delegates and Events[^]

2)The most common use of the delegates in .NET are for defining events and events handlers;
Event Tutorials[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 8-May-15 2:39am    
You know, this is a very shallow explanation. First of all, you mix up delegate types and the delegate instances, which are classes which have invocation lists, very sophisticated behavior, and so on.
I would rather point out that the question does not make sense. One should just learn the whole topic.
—SA
Member 11621271 8-May-15 3:19am    
Thank you Raul Iloc.
Raul Iloc 8-May-15 9:13am    
Welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900