gpt4 book ai didi

c# - C# 文件可以包含文件级摘要注释吗?

转载 作者:太空狗 更新时间:2023-10-30 00:15:52 24 4
gpt4 key购买 nike

例如

Foo.cs:

using System;

/// <summary>
/// This file contains Foo and Bar-related things.
/// </summary>

namespace Xyz {


class FooThing {
}

}

C# 支持这样的 XMLDoc 注释吗?

最佳答案

不,XML 文档注释只能出现在特定类型的元素上,如所述in this article :

In source code files, documentation comments that precede the following can be processed and added to the XML file:

Such user-defined types as a class, delegate, or interface

Such members as a field, event, property, or method

如果您在文件中放置一个文件级 XMLDoc 样式的注释,它将附加到下一个类或恰好出现的其他元素。某些文档工具(如 SandcaSTLe)提供了一种添加 namespace 级 XMLDoc 注释的方法,但它们通常出现在单独的文件中。

当然,您可以在每个文件中使用 XMLDoc 样式的注释,例如版权 header 或类似内容,只需使用标准/* */样式的注释 block 即可。

关于c# - C# 文件可以包含文件级摘要注释吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10761455/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com