现在的位置: 首页 > 综合 > 正文

委托使用三部曲

2017年10月02日 ⁄ 综合 ⁄ 共 220字 ⁄ 字号 评论关闭

委托使用三部曲: 
    1. 声明 
      delegate int ProcessDelegate(int param1, int param2); 
     2. 委托变量 
     ProcessDelegate Process; 
     3. 绑定 
     mutiply(int i, int j); 
     Process = new ProcessDelegate(mutiply); 
     4. 调用 
     int result = Process(2,3);

抱歉!评论已关闭.