- class Test
- {
- static void Main()
- {
- B oo = new B();
- K.Kevent i = new K.Kevent(oo.gg); //K.Kevent i = oo.gg; 都可以
- int k = i();
- Console.Write(k);
- }
- }
- class K
- {
- public delegate int Kevent();
- public event Kevent update;
- public void kkkkk()
- {
- if (update != null)
- {
- update();
- }
- }
- }
- class B
- {
- public int gg()
- {
- //Console.Write("gogo/n");
- return 1;
- }
- }
委托返回值
最新推荐文章于 2023-10-09 13:41:37 发布