c#.net中的扩展方法,我们可以在任何地方调用它们吗 [英] extension methods in c#.net can we call them anywhere

查看:52
本文介绍了c#.net中的扩展方法,我们可以在任何地方调用它们吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在项目或其他项目中的任何地方使用委托吗?
是否使用具有主要功能的类开发项目

thanq

can we make use of delegates anywhere in the project or different project.
if develop the project with class with main function

thanq

推荐答案

您可以在可见定义的任何地方使用扩展方法,即您必须在项目文件中引用了包含的类.
You can use Extension Methods anywhere where the definition is visible i.e. you must have referenced the containing class in your project file.


请看下面的链接..

http://www.dotnetperls.com/extension [
look at belowing link..

http://www.dotnetperls.com/extension[^]


这篇关于c#.net中的扩展方法,我们可以在任何地方调用它们吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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