Is multicast delegate create new reference for each chaining? or its a value type (MSDN says otherwise)? I don't understand, please take look at the following code.
using System;
class TestClass
{
static void Main()
{
Action origin = new Action(() => { Console.WriteLine("1st line"); });
Action copyFromOrigin;
copyFromOrigin = origin;
origin += new Action(() => { Console.WriteLine("2nd line"); });
copyFromOrigin.Invoke();
//result is "1st line", why the "2nd line" is missing?
//shouldn't the copyFromOrigin is referencing the origin?
Console.ReadKey();
}
}