Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6542811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:16:19+00:00 2026-05-25T11:16:19+00:00

Three related idioms: event, delegate, event-handler. I always get confused by who is added

  • 0

Three related idioms: event, delegate, event-handler. I always get confused by who is “added” to who.

event += handler
event += delegate
handler += delegate

From what I know:

  • delegate: a pointer to a function with a known signature.
  • event-handler: a delegate which is registered to an event. Basically, is it the same as a delegate?
  • event: a list of delegates\event-handlers which are executed when the event is invoked using event()

What confuses me more is this signature in MSDN:

public delegate void EventHandler(Object sender, EventArgs e)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:16:19+00:00Added an answer on May 25, 2026 at 11:16 am

    Here is my summary (please correct me if I’m wrong):

    • delegate is a pointer to a method (instance\static)

    • eventHandler is a delegate with a specific signature (sender, eventArgs)

    • event is an abstraction of accessing a delegate of any type, but it’s usually an eventHandler by convention

      //We declare delegates as a new type outside of any class scope (can be also inside?)
      
          public delegate retType TypeName (params...)
      
      //Here we assign
      
          public TypeName concreteDeleagteName = new TypeName (specificMethodName);
      
      //Declaring event
      //a. taken from http://stackoverflow.com/questions/2923952/explicit-event-add-remove-misunderstood
      
      private EventHandler _explicitEvent;
      public event EventHandler ExplicitEvent
      {
         add
         {
             if (_explicitEvent == null) timer.Start();
             _explicitEvent += value;
         }
         remove
         {
            _explicitEvent -= value;
            if (_explicitEvent == null) timer.Stop();
         }
      }
      
      //or: b.auto event - the compiler creates a "hidden" delegate which is bounded to this event
            public event TypeName eventName;
      

    I want to recommend the great article Event Handling in .NET Using C#.

    So we can only attach (eventName):

    eventName += new TypeName (specificMethodName);
    

    Which is equivalent to (_eventName is a delegate\eventHandler):

    _eventName += new TypeName (specificMethodName);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is a socket related function call in my code, that function is from
I know I've probably posted three questions related to this then deleted them, but
XML data from three related tables, what's the most appropriate, regarding later parsing speed,
i want to fetch the count from three different table which is not related.
My question really has three related parts which I hope you can help me
I've got a CAkePHP 1.2 site. I've got three related Models/tables: A Comment has
In a simple app I'm working on, I've got three related assemblies: MyCompany.Geography.Windows.Forms which
Three SHA512Managed related questions: Is SHA512Managed considered the best one-way hash available in .NET
What is the difference between these three heavily related fields? Is there one specific
I have these three related class members: vector<Frame*>* poolFrames; vector<Frame*>*::iterator frameIterator; vector<vector<Frame*>::iterator>* poolFrameIterators; When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.