没有主体的C#方法 [英] C# methods with no body

查看:171
本文介绍了没有主体的C#方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是C#的新手,在我将要研究的代码库中遇到了类似的事情(这些特定示例来自Microsoft.Extensions.CommandLineUtils).

I'm new to C# and have come across stuff like this in the codebase I'll be working on (these specific examples are from Microsoft.Extensions.CommandLineUtils).

public CommandArgument Argument(string name, string description, Action<CommandArgument> configuration, bool multipleValues = false);
public CommandArgument Argument(string name, string description, bool multipleValues = false);

我真的只想知道调用此函数的含义以及调用这些函数时的实际情况?我猜他们是具有一些编译时魔术的代理,但不确定.

I really just want to know what this construct is called and what's actually going on when you call these functions? I'm guessing they are proxies with some compile time magic but not sure.

推荐答案

这不是有效的C#代码.

It is not a valid C# code.

很有可能您在VS.Net中单击了转到定义"/F12,并且向您显示了外部DLL的元数据.

Most probably you clicked "Go to Definition" / F12 in VS.Net, and you were presented with metadata of external DLL.

这篇关于没有主体的C#方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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