相关疑难解决方法(0)

如何在VS 2010中为变量/字段/列表编写注释/文档?

///<summary>
///This is summary for some class or method
///</summary>
Run Code Online (Sandbox Code Playgroud)

类或方法的文档.但是如何为简单的变量或列表编写这个?

我使用Visual Studio 2010,当我将鼠标悬停在某个列表,属性或者我希望看到的某种摘要(在那个小工具提示中)时,我已经写了那个特定的东西.

///<doc>
///always use this list!
List<String> beer = new List<String>();
Run Code Online (Sandbox Code Playgroud)

编辑:好的,我们已经发现,它像往常一样在你的班级中发表评论,但是OUTSIDE方法或功能!!

有什么办法在方法中记录/评论吗?

public class BeerForall
{
    /// <summary>
    /// it works here
    /// </summary>
    public List<String> beer = new List<string>();

    public String giveBeer()
    {
        /// is not working, u can not comment
        /// <summary>
        /// test test, not working
        /// </summary>
        List<String> moreBeer = new List<string>();

        return "beer";
    }
}
Run Code Online (Sandbox Code Playgroud)

.net c# visual-studio-2010 xml-documentation visual-studio

18
推荐指数
3
解决办法
3万
查看次数