简体   繁体   English

在C#Visual Studio中为枚举提供描述性帮助上下文吗?

[英]Providing descriptive help context for Enums in C# Visual Studio?

Is it possible to have help context displayed for each individual enum on code drop down display? 是否可以在代码下拉显示中为每个枚举显示帮助上下文? (ie control space ?) (即控制空间?)

eg 例如

public enum Moods
{
    Depressed = 1,  ///On Rainy Days use this
    BlownAway = 2, ///On Stormy nights use this
    Ferengi = 3  //Use this for Profit and glory
}

and later on in code have the specific enum and it's comment displayed in the code completion drop down when we type : Moods. 稍后在代码中输入特定的枚举,并在键入: Moods.时在代码完成下拉列表中显示其注释Moods.

For intellisense descriptions, use the <summary> tag, as in: 对于智能感知描述,请使用<summary>标记,如下所示:

/// <summary>
/// Various moods
/// </summary>
public enum Moods
{
    /// <summary>
    /// On Rainy Days use this
    /// </summary>
    Depressed = 1,  
    /// <summary>
    /// On Stormy nights use this
    /// </summary>
    BlownAway = 2, 
    /// <summary>
    /// Use this for Profit and glory
    /// </summary>
    Ferengi = 3  
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM