C#?????????????????
???????????? ???????[ 2014/5/20 11:54:47 ] ????????Net ???????
?????????????????÷?????????????????????????????????????????????????????????????????á?????????????????NET Framework??CLR?????????????????????????????????????????????й???????????????????????????е???????????C#??????????й??????÷?????????????????????????????????н?????????
???????????????Χ??????????
????//1.???????
????//2.??е??????
????//3.??е?????????????????????????????????
????//????????????????????????????з??????????
??????????????????????????????????????????????????????д????
?????????е????
??????C#????ù????delegate??????С???????е??????????
????//??е????
????// [???????η?] delegate ???????? ?????(?????б?....)
??????????????????????????
???????磺Delegate void d??int x??
?????????????????????????
??????????????????????????б????t??п???????????????????????
?????????????????????з?????????
????“??д???????”???????????????????
????“??д???????”????????????????????? null???????????
????????????
???????磺
Delegate void d??int x??
delegate void D(int x);
class C
{
public static void M1(int i) {...}
public void M2(int i) {...}
}
class Test
{
static void Main() {
D cd1 = new D(C.M1); // static method
Test t = new C();
D cd2 = new D(t.M2); // instance method
D cd3 = new D(cd2); // another delegate
}
}
|
??????
???·???
??????????????????
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