Discover the top 5 tips for understanding .NET Interop
Home | Submit an interview question | Filter by category | Filter by job function | Filter by company
 
Member Information
UserId/Email
Password
 
Forgot Password
Technology Category
.NET (1836)
Languages (142)
Database (347)
Operating System (65)
Reporting (6)
Third-Party Tools (2)
Testing (184)
OOP (85)
Web Development (44)
Design Patterns (90)
General (17)
Networking (98)
Hardware (63)
Brain Exercise (4)
Others (45)
 Our Network
.NET Heaven
C# Corner
DbTalks
Interview Corner
Longhorn Corner
Mindcracker
VB.NET Heaven
Home » .NET » .NET
What is the difference between an event and a delegate?
Posted by Prabhu Raja Dec 25, 2011
Viewed : 2751 times
Major Category : .NET
Minor Category : ASP.NET
Total Replies : 1
 EDITORIAL ANSWER  
No Reply Yet
 ANSWERS BY USERS  
Prabhu Raja
Dec 25, 2011
An event is just a wrapper for a multicast delegate. Adding a public event to a class is almost the same as adding a public multicast delegate field. In both cases, subscriber objects can register for notifications, and in both cases the publisher object can send notifications to the subscribers. However, a public multicast delegate has the undesirable property that external objects can invoke the delegate, something we'd normally want to restrict to the publisher. Hence events - an event adds public methods to the containing class to add and remove receivers, but does not make the invocation mechanism public.
    
1
 
Nevron Chart
 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Advertise with us
Current Version: 4.2011.13.2
 © 1999 - 2012  Mindcracker LLC. All Rights Reserved