C#?????????Delegates??
???????????? ???????[ 2016/6/3 10:15:53 ] ??????????????????? C#
??????
?????????C#??????????????????????????????????????????С?
????1. ?????????
??????????????????ν?????У????????????????????????????????ж??в?????????????????????????????????????????2???????
??????1?? ??????????????????????????????????????????
??????2?? ???????????????У?????????????????????
??????????????????????????洢???????????
?????????????????????????????洢???????о???????????????????????????????????е??????а????????з?????????С?
????2. ???????????
???????????????????????????????????????????????????????????????????????????????????
????C#
????delegate void MyDel(int x);
?????????????????
??????1?? ??deleagate?????????
??????2??????????+?????????+?????б??
????3. ??????б???
????C#
????MyDel del1??del2;
????4. ???????б???
????(1) ???new?????
????new????????????????????£?
?????????????
????????????????а???????????б??е??????????????????????????????????????????????
????C#
????del1 = new MyDel( myInstObj.MyM1 );
????del2 = new MyDel( SClass.OtherM2 );
????(2)???????
????????????????????????????ɡ????????????????????????????????????????????????????????
????C#
????del1 = myInstObj.MyM1;
????del2 = SClass.OtherM2;
????5. ??????
???????????????????????????????????????????????????б????е??????????á????????????????????????
????C#
????MyDel del;
????del = myInstaObj.MyM1; //??г????
????del = SClass.OtherM2;//?????????????????y???????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11