using System.Linq.Expressions;
using System.Reflection;
namespace XYY.Core.Standard.ExcelHelper.MSExcelHelper
{
    public class ExcelMappingItem
    {
        /// <summary>
        /// 列名
        /// </summary>
        public string ColumnName
        {
            get; set;
        }

        public ExcelMappingItem Name(string name)
        {
            this.ColumnName = name;
            return this;
        }

        public string ColumnAnnotation
        {
            get; set;
        }

        public ExcelMappingItem Annotation(string annotation)
        {
            this.ColumnAnnotation = annotation;
            return this;
        }

        public PropertyInfo PropertyInfo
        {
            get; set;
        }

        /// <summary>
        /// 列名表达式
        /// </summary>
        public LambdaExpression LambdaExpression
        {
            get; set;
        }
         
        /// <summary>
        /// 列宽，默认使用该列文本值的最长宽度。
        /// 限制最长宽度为50个字符。
        /// </summary>
        public int ColumnWidht
        {
            get; set;
        }

        public ExcelMappingItem Width(int width)
        {
            this.ColumnWidht = width;
            return this;
        }

        /// <summary>
        /// 格式化文本
        /// </summary>
        public string ColumnFormattext
        {
            get; set;
        }

        public ExcelMappingItem Formattext(string text)
        {
            this.ColumnFormattext = text;
            return this;
        }
    }
}
