using System;
using System.Runtime.InteropServices;

namespace DeviceRepair.Models.Attr
{
    /// <summary>
    /// 枚举描述特性
    /// </summary>
    [Serializable]
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Enum, AllowMultiple = false, Inherited = false)]
    [ComVisible(true)]
    public class ComboBoxItemAttribute : Attribute
    {
        private string _Caption;
        /// <summary>
        /// 枚举描述
        /// </summary>
        public string Caption
        {
            get { return _Caption; }
            set { _Caption = value; }
        }

        private bool _IsIgnore;
        /// <summary>
        /// 是否忽略
        /// </summary>
        public bool IsIgnore
        {
            get { return _IsIgnore; }
            set { _IsIgnore = value; }
        }

        public ComboBoxItemAttribute() : this("", false)
        {

        }

        public ComboBoxItemAttribute(string caption, bool isIgnore)
        {
            Caption = caption;
            IsIgnore = isIgnore;
        }
    }
}
