public void SetRange(int firstCol, int lastCol, SheetColumn column) { if (lastCol < firstCol) throw new InvalidOperationException("Invalid range."); var node = GetNode(firstCol); node.Value.Data = column; node.Value.LastColumn = lastCol; var next = node.Next; while (next != null && next.Value.FirstColumn <= lastCol) { var at = next; next = at.Next; if (at.Value.LastColumn <= lastCol) data.Remove(at); else at.Value.FirstColumn = lastCol + 1; } }
/// <summary> /// Used in loading data /// </summary> /// <param name="firstCol"></param> /// <param name="lastCol"></param> /// <param name="sheetColumn"></param> internal void AppendRange(int firstCol, int lastCol, SheetColumn sheetColumn) { data.AddLast(new SheetColumnRange { FirstColumn = firstCol, LastColumn = lastCol, Data = sheetColumn }); }