How do I reference parameters to other methods in XML documentation?

拈花ヽ惹草 提交于 2019-12-12 10:49:00

问题


My code contains a class with one method that returns an object that was originally passed as a parameter to another method. I would like to indicate this relationship in the XML documentation mark-up.

class XmlDocThing
{
    /// <summary>
    /// Documentation for the other method.
    /// </summary>
    /// <param name="howDoIReferToThis">Magic object.</param>
    public void AnotherMethod(object howDoIReferToThis) { }

    /// <summary>
    /// Documentation for this method.
    /// </summary>
    /// <returns>The object passed as the <paramref name="howDoIReferToThis"/>
    /// argument of the <see cref="AnotherMethod"/> method.</returns>
    public object FromThisMethod() { return null; }
}

This results in the warning:

Warning 1 XML comment on 'MyNamespace.XmlDocThing.FromThisMethod()' has a paramref tag for 'howDoIReferToThis', but there is no parameter by that name

The <see cref="AnotherMethod"/> element to do the method reference works as expected, but <paramref> doesn't appear to have a cref attribute (which only seems to apply to method and property members anyway), or any equivalent.

Is this even possible, and if so, how?

来源:https://stackoverflow.com/questions/37433603/how-do-i-reference-parameters-to-other-methods-in-xml-documentation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!