private static ExcelColumnInfo LookUpColumn(IList <ExcelColumnInfo> columnList, ExcelColumnOverrideInfo columnOverride) { ExcelColumnInfo existColumn = null; if (columnOverride.Index.HasValue && columnOverride.Index.Value < columnList.Count) { existColumn = columnList[columnOverride.Index.Value]; } if (existColumn == null && !String.IsNullOrEmpty(columnOverride.Title)) { existColumn = columnList.FirstOrDefault(c => c.Title == columnOverride.Title); } return(existColumn); }
private static IList <ExcelColumnInfo> RemoveColumn(IList <ExcelColumnInfo> columns, ExcelColumnOverrideInfo removeInfo) { var toRemoveColumn = LookUpColumn(columns, removeInfo); columns.Remove(toRemoveColumn); return(columns); }