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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:50:06+00:00 2026-05-23T16:50:06+00:00

I want to identify all delegates of a class using reflection. I don’t want

  • 0

I want to identify all delegates of a class using reflection. I don’t want to invoke them, just identify. I suppose that I may use getMembers() like that :

Type t = myType;
MemberInfo[] mia = t.GetMembers(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).OrderBy(item => item.Name).ToArray();
foreach (MemberInfo m in mia)
{
    //Find delegates
}

EDIT : Delegate example :

class ClassTest
{
    public delegate void SampleEventHandler(object sender, EventArgs e);
}

It’s possible with this method, or another ?

Thanks for your answers!

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

    A delegate is just a (special, compiler-generated) class, that may be declared inside a class as a nested type – but bear in mind that they may also be declared directly in a namespace, like normal classes.

    This will find you all nested types in a given type t, that are delegates:

    private IEnumerable<Type> DelegatesDefinedInType(Type t) 
    {
        var nestedTypes = t.GetNestedTypes();    
        return nestedTypes.Where(typeof(Delegate).IsAssignableFrom);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Identify all objects of given class for further processing I want to
Let's say we have a string: abcbcdcde I want to identify all substrings that
I want to quickly identify all writable files in the directory. What is the
I want to identify anchor tags that have an href containing a particular string
I want to identify all rows whose content in a clob column is not
I want to identify all the available wifi networks currently available. I am checking
I want to identify an UDP or TCP packet that have its source IP
Given an HTML document, I want to identify all the numbers in the document
i want to dynamically add a class to all rows of a table except
I want identify all mouse click event in PreTranslateMessage, but when I use WM_LBUTTONDOWN

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.