欢迎来到我的博客
Civil 3D开发与应用,欢迎加入QQ群:484124761
AutoCAD开发,欢迎加入QQ群:193522571

visual studio 中为命名空间添加xml注释

Using NamespaceDoc and NamespaceGroupDoc Classes (ewsoftware.github.io)

 

Using NamespaceDoc and NamespaceGroupDoc Classes

If your build tool supports it, namespace comments can also be specified and maintained in your source code by adding an empty NamespaceDoc class to each namespace. When comments for this class are found in the XML comments files they will be used as the namespace comments.

To keep the NamespaceDoc class from appearing in the help file, leave off the public keyword and mark it with a CompilerGenerated attribute. This will cause the class to be automatically ignored when reflection information is generated for the assembly. The following is an example:

namespace Company.Product.Widgets
{
    /// <summary>
    /// These are the namespace comments for <c>Company.Product.Widgets</c>.
    /// </summary>
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    class NamespaceDoc
    {
    }
}

If the project has namespace grouping enabled, you can also maintain the namespace group comments using a NamespaceGroupDoc class in a similar fashion. The following is an example:

namespace Company.Product
{
    /// <summary>
    /// These are the group comments for namespaces in <c>Company.Product</c>.
    /// </summary>
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    class NamespaceGroupDoc
    {
    }
}

 

posted @ 2024-05-30 16:23  david96007  阅读(14)  评论(0编辑  收藏  举报