Languages - DevSource
DevSource: Microsoft Developer Resource DevSource Home Sponsored by Microsoft Home Add Ons Architecture Languages Techniques Using VS Forums
Home arrow Languages arrow Page 6 - Working with Delegates in C#
Working with Delegates in C#
By Joe Mayo

Rate This Article: Add This Article To:

ADVERTISEMENT
Working with Delegates in C# - ' Summary '
( Page 6 of 6 )

Summary

This article focused on delegates and explained why they are valuable to C# application development. Delegates allow you to refer to methods to dynamically invoke code and call multiple methods together. When executed, each member of a delegate's invocation list is executed synchronously, in the order they were added. A delegate's invocation list can be manipulated by adding and removing delegates.

One of the primary uses of delegates in .NET is to implement callback methods for events. Events are safer than delegates for callbacks because they protect against accidental assignment and provide protection against direct invocation from outside code. Delegates allow you to refer to methods, invoke multiple methods simultaneously, and are the underlying mechanism for implementing C# events.



 
 
>>> More Languages Articles          >>> More By Joe Mayo
 



DevSource video
Devsource Video Series
Manipulating Society through Technology
Jeremy Bailenson, Director of the Virtual Human Interaction Lab at Stanford University, talks about virtual reality, avatars, Moore's law, how real world behaviors influence online reality, and societal manipulation through technology!
>> Play video
>> Read article
>> See all videos
DevLife Blog

Julia explores the Robotics Studio! (It's for more than you think.)

MSDev Blog

Messages for Bill Gates!

Make it Work
.NET makes runtime type checking a breeze. See what Peter has to say about it in this week's tips!
News
Microsoft Counts on App Support for Vista
Microsoft has taken pains to demonstrate that Windows Vista will have ample application support.
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.