Delegate.Invoke和代表之间的差异() [英] Difference between Delegate.Invoke and Delegate()

查看:107
本文介绍了Delegate.Invoke和代表之间的差异()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

delegate void DelegateTest();

DelegateTest delTest;

请告诉我打电话的区别 delTest.Invoke() delTest()?双方将执行代表当前线程的,对吧?

Whats the difference between calling delTest.Invoke() and delTest()? Both would execute the delegate on the current thread, right?

推荐答案

delTest()的形式是一个编译器辅助,它的下面就是真正的调用的invoke()

The delTest() form is a compiler helper, underneath it is really a call to Invoke().

这篇关于Delegate.Invoke和代表之间的差异()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆