0

在以下 xml 文档中的代码中,方法参数中的参数名称与 xml 文档中的参数名称不匹配。有没有办法自动更正 xml 文档签名或 resharper 中提供的任何功能来自动更正 xml 文档。

#region Get Images

/// <summary>
///  Get Images 
/// </summary>
/// <param name="par1"></param>
/// <param name="par2"></param>
/// <returns></returns>
public Collection<UserImage> GetImages()
{
    return GetImages("");
}

/// <summary>
///  Get Images 
/// </summary>
/// <param name="par1"></param>
/// <param name="par2"></param>
/// <returns></returns>
public Collection<UserImage> GetImages(string imageType)
{
    return GetImages(0, imageType);
}

/// <summary>
///  Get Images 
/// </summary>
/// <param name="par1"></param>
/// <param name="par2"></param>
/// <returns></returns>
public Collection<UserImage> GetImages(int imageId)
{
    return GetImages(imageId, "");
}

/// <summary>
///  Get Images 
/// </summary>
/// <param name="par1"></param>
/// <param name="par2"></param>
/// <returns></returns>
public Collection<UserImage> GetImages(int imageId,string imageType)
{
    return null;
}

#endregion

例如,我想要这样的带有 xml 文档的方法:

/// <summary>
///  Get Images 
/// </summary>
/// <param name="imageId"></param>
/// <param name="imageType"></param>
/// <returns></returns>
public Collection<UserImage> GetImages(int imageId,string imageType)
{
    return null;
}

#endregion
4

2 回答 2

6

GhostDoc will do this for you. After installation you get a new context menu item in VS 'Document this' (and a corresponding keyboard shortcut).

If no XML comments are present, it will add them. If they are already present, they should get updated as you require.

http://submain.com/products/ghostdoc.aspx

于 2009-09-19T15:42:37.017 回答
1

我知道使用 R#“自动更正”xml 的唯一方法是删除现有的 xml 文档并再次点击 ///。对不起,我没有更好的答案。

我相信这是不可能的,因为 R# 不需要更正 xml 文档或方法签名。

于 2009-09-19T15:39:42.843 回答