【问题标题】:How to make a documentation for a function which has an IDictionary<TKey, TValue> parameter? [duplicate]如何为具有 IDictionary<TKey, TValue> 参数的函数制作文档? [复制]
【发布时间】:2012-02-01 16:01:11
【问题描述】:

可能重复:
C#: How to reference generic classes and methods in xml documentation

我想为我的静态函数创建一个简短的文档(在 VS2010 中),它有一个 IDictionary&lt;TKey, TValue&gt; 参数。

例如:

public static string newDocument(IDictionary<string,string> listMap)
{
//the code
}

我想在VS2010中创建一个文档,当你输入/ 3次后会自动生成如下:

/// <summary>
/// create something
/// </summary>
/// <param name="listMap">Text here</param>
/// <returns></returns>
public static string newDocument(IDictionary<string,string> listMap)
    {
    //the code
    }

我想这样写:字典key是什么东西,字典value是另一个东西。

怎么做?

【问题讨论】:

    标签: c# xml-documentation


    【解决方案1】:

    StyleCop rules guide 不提供任何记录 IDictionaries 的规则。这很简单,但我建议如下:

    /// <param name="listMap">List map parameter representing xxx. The keys in the dictionary are XXX and the values are YYY</param>
    

    【讨论】:

    • 我知道但是……如果没有其他办法,我可能会采用这种格式
    猜你喜欢
    • 2012-07-25
    • 2013-04-08
    • 1970-01-01
    • 1970-01-01
    • 2014-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-22
    相关资源
    最近更新 更多