在.NET项目(沙堡)命名空间的文件? [英] Namespace documentation on a .Net project (Sandcastle)?

查看:183
本文介绍了在.NET项目(沙堡)命名空间的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用沙堡的前一段时间,以产生一个文档网站为我们的项目之一。它的工作非常好,但我们一直只写文档,在我们的项目中的类,方法,属性(...),并有对整个项目和项目部件/模块/命名空间完全独立的文档。这将是很好,如果我能合并在一起的文件和相应的文件添加到生成的辅助文件,但我无法弄清楚如何做到这一点。

I started using Sandcastle some time ago to generate a Documentation Website for one of our projects. It's working quite well but we've always only written documentation for classes, methods, properties (...) in our project and had completely separate documentation for the overall project and project parts/modules/namespaces. It would be nice if I could merge that documentation together and add respective documentation to the generated helper files but I can't figure out how to do it.

只是添加注释命名空间的声明似乎并没有工作(C#):

Just adding comments to the namespace declaration doesn't seem to work (C#):

/// <summary>
/// My short namespace description
/// </summary>
namespace MyNamespace { ... }

有谁知道如何做到这一点?我知道这是可能以某种方式,这将是非常不错的...:)

Does anyone know how to do this? I know it's possible somehow and it would be really nice to have... :)

推荐答案

沙堡还支持NDoc的风格命名的文件,它可以让你坚持了文档中的源文件:

Sandcastle also supports the ndoc-style namespace documentation, which allows you to stick the documentation in the source files:

只需创建一个非公共类名为NamespaceDoc你想要记录的命名空间和XML文档注释该类将用于命名空间。

Simply create a non-public class called NamespaceDoc in the namespace you want to document, and the xml doc comment for that class will be used for the namespace.

用[编译器生成]属性为prevent类本身无法显示的文档中了装饰它。

Adorn it with a [CompilerGenerated] attribute to prevent the class itself from showing up in the documentation.

例如:

namespace Some.Test
{
    /// <summary>
    /// The <see cref="Some.Test"/> namespace contains classes for ....
    /// </summary>

    [System.Runtime.CompilerServices.CompilerGenerated]
    class NamespaceDoc
    {
    }
}

在沙塔工作项目位于 这里

The work item in SandCastle is located here.

这篇关于在.NET项目(沙堡)命名空间的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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