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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:29:31+00:00 2026-06-15T13:29:31+00:00

After doing some reading I understand that handlers invocation order is the same order

  • 0

After doing some reading I understand that handlers invocation order is the same order as subscribed but it is not guaranteed .

So lets say I have :

public event MYDEl ev;

and subscribers do :

ev+=GetPaper;
ev+=Print;
ev+=EjectPaper;

What is the best practice mechanism of preserving +assuring the execution list order ?

  • 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-06-15T13:29:32+00:00Added an answer on June 15, 2026 at 1:29 pm

    If it’s a field-like event, it will use simple delegate combination as per Delegate.Combine, and that is guaranteed to preserve subscription order. From the docs for the return value:

    A new delegate with an invocation list that concatenates the invocation lists of a and b in that order.

    In general for events, nothing is guaranteed – it’s up to the implementation. Heck, it could ignore every subscription you ever make. In reality though, any sane implementation will preserve ordering.

    EDIT: Sample of a mischievous event implementation:

    public class BadEventPublisher
    {
        public event EventHandler Evil
        {
            add { Console.WriteLine("Mwahahaha!"); }
            remove { }
        }
    
        protected virtual void OnEvil(EventArgs e)
        {
            Console.WriteLine("Who cares? Subscriptions are ignored!");
        }
    }
    

    This is just like writing a property which (say) returns a random number from the getter and ignores the value in the setter. It’s more of a theoretical problem than a real one.

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

Sidebar

Related Questions

Update: I updated this after doing some digging and realizing that this might be
I was doing some digging around into delegate variance after reading the following question
After doing some reading about the Module Pattern, I've seen a few ways of
after reading a few articles, I am still not sure I understand Multi-threading to
I've been doing some reading on mysqli_real_escape_string(), and, after getting my content properly escaped,
After doing some reading I notice Apple pushes the use of delegates on controllers
after doing some preliminary searching, I was not able to find much information on
After doing some Core animations using: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.5]; [self setAffineTransform:CGAffineTransformIdentity]; [UIView
After doing some research on the subject, I've been experimenting a lot with patterns
After doing some experimentation with move semantics with an array type I created, I

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.