码迷,mamicode.com
首页 > 其他好文 > 详细

delegate, event - 里面涉及的参数类型必须完全一致,子类是不行的

时间:2014-07-24 21:39:32      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:io   c   cti   public   test      action   delegate   

public void TestF()
{
Test += Fun;
}

public void Fun(Person p) { }  // 如 Person变成 SubPerson,则报错。。public void Fun(SubPerson p) { }

public event Action<Person> Test;

delegate, event - 里面涉及的参数类型必须完全一致,子类是不行的,布布扣,bubuko.com

delegate, event - 里面涉及的参数类型必须完全一致,子类是不行的

标签:io   c   cti   public   test      action   delegate   

原文地址:http://www.cnblogs.com/bdbw2012/p/3865979.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!