title: About C# delegate/event processing
body: <p>I have a simple program that doesn't behave the way I expected it to behave.  I was under the impression that both Method Signatures would run in the order of the Invocation List of the Delegate during the CallEvent() method and make the Test Property equate to 40.  Hence:</p>
  
  <pre><code>Test += (20+15);
  Test += (20-15);
  Test == 40;
  </code></pre>
  
  <p>As it would turn out, this assignment is equal to 5, which is the value of the subtraction.  If it did the addition first then replaced it with subtraction, doesn't that defeat the purpose of the Test += assignment? Maybe it is bypassing the addition all together (however unlikely).  I suspect something more inherent is going on that I just can't see with my current programming knowledge.</p>
  
  <p>Please and Thank You!
  LiquidWotter</p>
  
  <pre><code>//MY NAMESPACE
  namespace MyNamespace
  {
      //MAIN
      private static void Main(string[] args)
      {
          //CREATE MY OBJECT
          MyClass MyObject = new MyClass();
  
          //ADD CALLS TO EVENT
          MyObject.MyEvent += Add;
          MyObject.MyEvent += Sub;
  
          //CALL EVENT AND WRITE
          MyObject.CallEvent(20, 15);
          Console.WriteLine(MyObject.Test.ToString());
  
          //PAUSE
          Console.ReadLine();
      }
  
      //ADDITION
      private static int Add(int x, int y)
      { return x + y; }
  
      //SUBTRACTION
      private static int Sub(int x, int y)
      { return x - y; }
  
      //MY CLASS
      public class MyClass
      {
          //MEMBERS
          public delegate int MyDelegate(int x, int y);
          public event MyDelegate MyEvent;
          public int Test { get; set; }
  
          //CONSTRUCTOR
          public MyClass()
          {
              this.Test = 0;
          }
  
          //CALL Event
          public void CallEvent(int x, int y)
          {
              Test += MyEvent(x, y);
          }
      }
  }
  </code></pre>