//默认ZFLText属性值为"Label" 
[DefaultValue(typeof(DisplayMode), "Label")]
 public DisplayMode ZFLText
  {
      get;
      set;
  }


[Serializable]
    public enum DisplayMode
    {
        /// <summary>
        
/// 显示文本
        
/// </summary>
        Label,
        /// <summary>
        
/// 显示值
        
/// </summary>
        Value
    }

 效果如下:

C# 枚举在属性中运用

相关文章: