许多常量的XML文档

时间:2013-01-07 19:43:27

标签: c# documentation sandcastle

有没有办法将XML文档 summary 标记放在同一行作为类中的常量?

我有一个定义了许多常量返回值的类,并且每个类之间都有注释行使得它有点难以阅读和维护。 (同样的问题适用于枚举值。)

下面的代码显示了我的代码现在的样子。如果有办法,我想保持这样。

public class MyUtilClass
{
    public static int  UTIL_SUCCESS         = 0;   // This is an example comment for success.
    public static int  UTIL_WARNING_LEVEL_1 = 1;   // This is an example comment for warning level 1.
    public static int  UTIL_WARNING_LEVEL_2 = 2;   // This is an example comment for warning level 2.
    public static int  UTIL_FAILED          = 3;   // This is an example comment for failure.
}

我正在使用http://shfb.codeplex.com/生成我的文档。

谢谢!

1 个答案:

答案 0 :(得分:3)

不,我认为您必须将XML文档包含在它正在记录的内容之上。但是,您可以将摘要标记及其内容放在一行中:

/// <summary>Some content</summary>
public static int  UTIL_SUCCESS         = 0;
相关问题