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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:15:26+00:00 2026-05-26T22:15:26+00:00

A long time ago, I saw something that allowed you to chain a series

  • 0

A long time ago, I saw something that allowed you to chain a series of methods together dynamically. Can’t remember if it was in C#, or C++.

It goes something like this:

Methods:

Foo();
Bar();
Moar();

An object is then created that subscribes (for lack of a better word) to any or all of the methods above (depending on the programmer’s specification), and whatever is passed into this object will run through all the subscribed methods.

I ask, because I am working on a kernel for a program, which depending on a variety of choices, may or may not need certain methods. Since this program needs to be very tightly coded (I prefer not to waste a processor cycle on an if / else statement…it will add up), I was wondering if anyone recalls what I am attempting to convey, and what the C# equivalent would be.

Thanks,
-R

  • 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-26T22:15:26+00:00Added an answer on May 26, 2026 at 10:15 pm

    It sounds like an event:

    declared:

    public event Action Something;
    

    subscribed:

    obj.Something += x.Foo;
    ...
    obj.Something += y.Bar;
    ...
    obj.Something += z.Moar;
    

    then invoked:

    protected virtual void OnSomething() {
        var handler = Something;
        if(handler != null) handler();
    }
    ...
    OnSomething(); // call ^^^^^^
    

    which would invoke all the 3 methods, but with loose coupling.

    Note you can do exactly the same just with a delagate rather than an event. Note also that events generally have a more specific void (object sender, SomeEventArgs args) signature (but this is convention, not a requirement).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I remember that I've seen this effect long time ago on a website. It
I remember hearing a long time ago that it was considered best practice to
A long time ago I remember reading that you should always use the smallest
A long time ago, I remember reading a quite strong recommendation from Microsoft against
A long time ago I used to program in C for school. I remember
I read a long time ago about a rule that using an object we
I got this idea a long time ago when i saw an app do
A long time ago I had an apple ][ . I remember the command
A long time ago I remember I could do this in Turbo Pascal 7.
Long long time ago was a Delphi, and any developer can rapidly build win32

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.