自定义委托

委托是个啥呢?

委托是个类,我们来验证一下

using System;
using System.Collections.Generic;

namespace CustomizeDelegate

{

  class Program
  {
    static void Main(string[] args)  
    {
      Type t = typeof(Action);
      Console.WriteLine(t.IsClass);//返回true,说明Action委托是类

    }

  }

}

答案是true,所以证明委托是个类。

现在写个自定义委托

猜你喜欢

转载自www.cnblogs.com/maomaodesu/p/11387031.html