進哥的布拉格

Chin Gooole's Blog

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
class Test
{
    
delegate void SimpleDelegate();

    
static void F()
    {
        System.Console.WriteLine(
"Test.F");
    }
    
static void Main()
    {
        SimpleDelegate d 
= new SimpleDelegate(F);

        Test.MultiCall(d, 
3);
    }

    
static void MultiCall(SimpleDelegate d, int count)
    {
        
for (int i = 0; i < count; i++)
        {
            d();
        }
    }
}
posted on 2008-10-28 15:15  進哥  阅读(101)  评论(0编辑  收藏  举报