奇妙的EventHandler
sing System;
using System.Linq;
using System.Runtime.InteropServices;
namespace ConTest
{
class Program {
public EventHandler ContentViewActive = delegate { };
static void Main(string[] args)
{
Program p = new Program();
p.ContentViewActive += delegate
{
Console.WriteLine("Welcome");
Console.WriteLine("To");
Console.WriteLine("You!");
};
p.ContentViewActive(new object(), new EventArgs());
/*输出结果
*Welcome
*To
*You *
* */
Console.Read();
}
}
}