为什么要使用代理而不是直接调用 [英] Why should use the delegates rather than directly calling

查看:159
本文介绍了为什么要使用代理而不是直接调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上我们直接使用invoke方法的对象,类名,但我们还有另一个

选项用于调用方法,即代表





为什么要使用代表而不是直接打电话



已经在google上搜索了很多结果但是可以不清楚解释



你可以解释为什么要使用





谢谢你。



我的尝试:



实际上我们是使用对象,类名直接调用方法,但我们有另一个

选项用于调用方法,即委托

Actually we are using object,class names for invoke method directly but we have another
option for calling methods i.e Delegates


why should use the delegates rather than directly calling

already search on google many of results are given but can't explain clearly

can u explain why should use


Thank u.

What I have tried:

Actually we are using object,class names for invoke method directly but we have another
option for calling methods i.e Delegates

推荐答案

你会很好的解释在这里找到: c# - 代表方法与一般方法 [ ^ ]和这里:为什么代表?为什么不直接调用方法? ·Nick Chamberlain [ ^ ]



祝你好运!
Quite good explanation you'll find here: c# - Delegate Methods vs General Methods[^] and here: Why Delegates? Why not Call Methods Directly? · Nick Chamberlain[^]

Good luck!


这篇关于为什么要使用代理而不是直接调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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