gpt4 book ai didi

c# - 属性/访问器的 XML 注释

转载 作者:太空狗 更新时间:2023-10-29 18:27:36 24 4
gpt4 key购买 nike

是否可以为 setget 访问器添加 XML 注释,这将在 Object Browser (VS 2010) 中可见?

/// <summary>
/// Something about property.
/// </summary>

public bool IsSomething
{
// get description

get
{
return isSomething;
}

// set description

set
{
// do some work
}
}

最佳答案

不,您不能直接在访问器上设置这些注释。然而,关于属性的注释可能非常全面,当您开始键入它们时,您将获得 IntelliSense 建议。如果您有扩展评论,您可能希望将额外的内容放在评论的备注部分:

/// <summary>
/// Something about the property.
/// </summary>
/// <remarks>
/// Some extra remarks that won't show up in the property's IntelliSense later.
/// </remarks>

关于c# - 属性/访问器的 XML 注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10770912/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com