日期:2014-05-17 浏览次数:20826 次
public delegate void MyDel();
public class myDel
{
public static event MyDel catshout;
public static void ratrun()
{
Console.WriteLine("run");
}
public static void test()
{
catshout += delegate {
Console.WriteLine(1);
};
}
}
//调用该方法 没有输出"run"
myDel.test();
public static void test()
{
catshout += delegate {
Console.WriteLine(1);
};
catshout();
}