Results 1 to 3 of 3

Thread: What Event does over the delegate?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Location
    Chennai
    Posts
    8

    What Event does over the delegate?

    Hai all,

    What does a Event does in the C# over the delegate, to my knowledge the delegates are similar to an functional pointer to a function or method whatever you call. Delegare invoke the function byref which it hold, and the event inturn call the delegate assigned when any event or action triggerd.

    My question: why can't we straightly invoke a delegate rather than going for a event?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: What Event does over the delegate?

    An event is basically a list of delegates. Each method that will act as a handler for the event gets added to that list. When the event is to be raised you only have to invoke the event itself to invoke every delegate containing an event handler. If the event mechanism didn't exist you have to invoke each delegate individually.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Location
    Chennai
    Posts
    8

    Re: What Event does over the delegate?

    Thanks pal....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width