c#xml对属性/评估者的评论

apo*_*pse 8 .net c# xml-comments

是否可以为对象浏览器(VS 2010)中的set和get asssessors添加xml-comments?

        /// <summary>
        ///   Something abot property.
        /// </summary>

        public bool IsSomething
        {
              // get description

              get
              {
                    return isSomething;
              }

              // set description

              set
              {
                    // do some work
              }
        }
Run Code Online (Sandbox Code Playgroud)

slu*_*ter 7

不,您不能直接在访问者上设置这些注释.然而,对该属性的评论可能非常全面,当您开始输入时,您将获得智能感知建议.如果您有扩展注释,您可能希望将额外的内容放在注释的备注部分:

    /// <summary>
    ///   Something about property.
    /// </summary>
    /// <remarks>
    /// Some extra remarks that won't show up in the property's intellisense later.
    /// </remarks>
Run Code Online (Sandbox Code Playgroud)