Example #1
0
        private void AddExcelColumnAttribute(PropertyInfo propInfo, int curIndex)
        {
            var attr = propInfo.GetCustomAttribute(typeof(ExcelColumn)) as ExcelColumn;

            if (attr != null)
            {
                ExcelIndex2PropertyIndex.Add(attr.Index, curIndex);
            }
        }
Example #2
0
        private void AddExcelColumnAttribute(PropertyInfo propInfo, int curIndex)
        {
            var attr = propInfo.GetCustomAttribute(typeof(ExcelColumn)) as ExcelColumn;

            if (attr != null)
            {
                if (attr.Index != null)
                {
                    ExcelIndex2PropertyIndex.Add(attr.Index ?? 0, curIndex);
                }
                else if (!string.IsNullOrEmpty(attr.ColumnName))
                {
                    ExcelColumnName2PropertyIndex.Add(attr.ColumnName, curIndex);
                }
            }
            else
            {
                ExcelColumnName2PropertyIndex.Add(propInfo.Name, curIndex);
            }
        }