Visual Studio 2010!

Read now >

View Now
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.
ADVERTISEMENT
ADVERTISEMENT

 

DevSource.com: Your Source for Visual Studio on Facebook
ADVERTISEMENT
Working with Delegates in C#
By Joe Mayo

Rate This Article: Add This Article To:

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 Microsoft Languages Articles          >>> More By Joe Mayo