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 7575521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:42:29+00:00 2026-05-30T16:42:29+00:00

I may be misunderstanding something fundamental here as I’m new to these concepts so

  • 0

I may be misunderstanding something fundamental here as I’m new to these concepts so please bear with me.

I’m currently removing methods from an event like so:

scheduleView.TouchDown -= scheduleView_TouchDown;

And then on other occasions – adding the methods:

scheduleView.TouchDown += scheduleView_TouchDown;

It all works fine so far, and I can understand it’s possible to add several methods, like so:

scheduleView.TouchDown += scheduleView_TouchDown;
scheduleView.TouchDown += scheduleView_AnotherTouchDownEventHandler;

But how would I then later check what methods were wired up to this event?

  • 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-30T16:42:30+00:00Added an answer on May 30, 2026 at 4:42 pm

    Interestingly, you can’t (at least, from the outside). An event is only obliged to offer 2 accessors – add and remove. There are other accessor methods defined in the CLI spec, but they aren’t used in C# or anywhere else AFAIK. The key point: we can’t ask an event what is subscribed (and indeed, we shouldn’t need to know). All you can do is: add or remove.

    If you are worried about double-subscribing, then note that if you try to unsubscribe and you haven’t actually subscribed, then under every sane implementation this is simply a no-op; which means you can do:

    // make sure we are subscribed once but **only** once
    scheduleView.TouchDown -= scheduleView_TouchDown;
    scheduleView.TouchDown += scheduleView_TouchDown;
    

    From the perspective of the code raising the event, you rarely need to know who – simply:

    // note I'm assuming a "field-like event" implementation here; otherwise,
    // change this to refer to the backing-field, or the delegate from the
    // event-handler-list
    var handler = TouchDown;
    if(handler != null) handler(this, EventArgs.Empty); // or similar
    

    There is also a way to break the delegate list into individual subscribers, but it is very rarely needed:

    var handler = TouchDown;
    if(handler != null) {
        foreach(EventHandler subscriber in handler.GetInvocationList()) {
            subscriber(this, EventArgs.Empty);
        }
    }
    

    The main uses for this are:

    • when you want to perform exception-handling on a per-subscriber basis
    • when the delegate returns a value or changes state, and you need to handle that on a per-subscriber basis
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm may be just misunderstanding something fundamental here but... Senario: I call System.Net.Sockets.NetworkStream 's
I believe that I may be missing something here, so please bear with me
I think I may have a misunderstanding of <xsl:variable\> and <xsl:value-of\> so perhaps someone
May I know how could I pass the value of driver from code behind
May I know if there is any way to remove non-alphabetical symbols from a
Ok so I think I must be misunderstanding something about SQL queries. This is
(very newbie questions) i may be misunderstanding this but on MSDN i believe it
I may be greatly misunderstanding this threading scenario, but that's why I'm asking. What
This may be a case of me just misunderstanding what I've read, but all
This may be my own misunderstanding of how Python imports and search paths work,

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.