c# - 在 cref 中使用时 "T:"是什么

标签 c# xml-comments

在此处使用 cref 属性时,T: 部分是什么意思?

<see cref="T:System.Windows.Form.Control"/>

<see cref="System.Windows.Form.Control"/>

最佳答案

当编译器在文档中生成 id 时,它本质上是对代码引用所指内容的注释。此处,T 表示所引用的名称 System.Windows.Form.Control 是一个类型,而不是命名空间或其他成员。

就其本身而言,文本 System.Windows.Form.Control 可能具有不同的含义。例如,它可以是命名空间,或者是 System.Windows.Form 对象的 Control 成员。这有助于描述它到底是什么。

您可以在 docs 中查看有关编译器使用的其他约定的更多信息。 .

其他前缀如下:

N   namespace
T   type: class, interface, struct, enum, delegate
F   field
P   property (including indexers or other indexed properties)
M   method (including such special methods as constructors, operators, and so forth)
E   event
!   error string

关于c# - 在 cref 中使用时 "T:"是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41255399/

相关文章:

c# - 将 "Service Account"证书存储与 .NET 2.0 HttpWebRequest 一起使用

vb.net - Visual Studio 2008 是否可以在不检查 "Generate XML documentation file"的情况下自动创建 XML 注释标签(仅限 VB.NET)?

php - XSLT/Xpath : Selecting a preceding comment

用于文件引用的 c# xml 代码注释

C# String.Format() 在 PHP 中等效?

c# - Xamarin Android Oxyplot 刷新不起作用

c# - 如何从我的 ApiController 中的 ActionFilterAttribute 访问属性?

c# - 不使用 Fortune 算法生成 Voronoi 图

c# - 从代码注释中引用 TFS 工作项

c# - 引用通用评论