如何记录方法的属性以及方法?

How to document the method's attributes along with the method?

是否可以在生成的 xml 文档中包含属性信息以及方法的文档?

例如,这段代码:

    /// <summary>
    ///     This is a summary.
    /// </summary>
    /// <param name="s"></param>
    /// <returns></returns>
    [MyAttribute("one", "two", "three")]
    public string MyMethod(string s)
    {
        throw new NotImplementedException();
    }

将在 XML 文档中生成类似这样的内容:

    <member name="M:MyNameSpace.MyMethod(System.String)">
        <summary>
            This is a summary.
        </summary>
        <param name="s"></param>
        <returns></returns>
    </member>

有什么方法可以在 XML 文档中得到类似的东西:

    <member name="M:MyNameSpace.MyMethod(System.String)">
        <attributes>
            <attribute name="MyAttribute">
                <param name="one"/>
                <param name="two"/>
                <param name="three"/>
            </attribute>
        </attributes>
        <summary>
            This is a summary.
        </summary>
        <param name="s"></param>
        <returns></returns>
    </member>

提前感谢您的所有回答!

不确定。但是阅读以下

https://msdn.microsoft.com/en-us/library/b2s063f7.aspx

你应该可以得到

<member name="M:MyNameSpace.MyMethod(System.String)">
    <attribute name="MyAttribute" values = "1,2,3">
    </attribute>
    <summary>
        This is a summary.
    </summary>
    <param name="s"></param>
    <returns></returns>
</member>

通过使用

///<attribute name="MyAttribute" values="1,2,3"></attribute>

https://msdn.microsoft.com/en-us/library/5ast78ax.aspx 你可以阅读:

The compiler will process any tag that is valid XML.

所以我猜你想要的都可以做到