using DeviceRepair.Models.Enum;
using System;
using System.Runtime.InteropServices;

namespace DeviceRepair.Models.Attr
{
    [Serializable]
    [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)]
    [ComVisible(true)]
    public sealed class HistoryGridFieldAttribute
    : Attribute
    {
        #region Fields

        /// <summary>
        /// 编码
        /// </summary>
        private string _Code;
        /// <summary>
        /// 文本描述
        /// </summary>
        private string _Description;

        private string _FormatString;

        private bool _AllowExport = true;
        private bool _AllowPrint = true;
        private int _ColumnSequence;
        /// <summary>
        /// 控件类型
        /// </summary>
        private HistoryFilterCtlType _CtlType;
        #endregion

        #region Ctor
        /// <summary>
        /// Ctor
        /// </summary>
        public HistoryGridFieldAttribute()
        {
        }
        /// <summary>
        /// Ctor
        /// </summary>
        public HistoryGridFieldAttribute(string _code, string _Desc, string _formatString, HistoryType _ctlType)
        {
            _Code = _code;
            _Description = _Desc;
            _FormatString = _formatString;
        }
        #endregion

        #region Property
        /// <summary>
        /// 编码
        /// </summary>
        public string Code
        {
            get { return _Code; }
            set { _Code = value; }
        }
        /// <summary>
        /// 文本描述
        /// </summary>
        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }

        public string FormatString
        {
            get { return _FormatString; }
            set { _FormatString = value; }
        }

        //列展示顺序【预留】
        public int ShowSequence
        {
            get { return _ColumnSequence; }
            set { _ColumnSequence = value; }
        }
        //是否允许打印【预留】
        public bool AllowPrint
        {
            get { return _AllowPrint; }
            set { _AllowPrint = value; }
        }
        //是否允许打印【导出】
        public bool AllowExport
        {
            get { return _AllowExport; }
            set { _AllowExport = value; }
        }
        /// <summary>
        /// 控件类型
        /// </summary>
        public HistoryFilterCtlType CtlType
        {
            get { return _CtlType; }
            set { _CtlType = value; }
        }
        #endregion
    }
}
