OpenXml.Excel.Data.ExcelDataReader.AdjustRow C# (CSharp) 메소드

AdjustRow() 개인적인 정적인 메소드

private static AdjustRow ( OpenXmlElement row, int capacity ) : IEnumerable
row OpenXmlElement
capacity int
리턴 IEnumerable
        private static IEnumerable<Cell> AdjustRow(OpenXmlElement row, int capacity)
        {
            if (row == null)
                return new Cell[] {};

            var cells = row.Elements<Cell>();

            var list = new Cell[capacity];
            foreach (var cell in cells)
            {
                var index = ExcelUtil.GetColumnIndexByName(cell.CellReference.Value);
                if (index < capacity)
                    list[index] = cell;
            }

            return list;
        }