public void Clear(int row, int column, int rowCount, int columnCount) { for (int i = row; i < (row + rowCount); i++) { for (int j = column; j < (column + columnCount); j++) { Sparkline item = this.Find(i, j); if (item != null) { SparklineGroup group = item.Group; group.Remove(item); if (group.Count == 0) { this.Remove(group); } } } } }
public void Move(Worksheet src, int fromRow, int fromColumn, int toRow, int toColumn, int rowCount, int columnCount) { if (object.ReferenceEquals(src, this.Sheet)) { this.Move(fromRow, fromColumn, toRow, toColumn, rowCount, columnCount); } else { this.MoveDataRange(src, fromRow, fromColumn, toRow, toColumn, rowCount, columnCount); for (int i = 0; i < rowCount; i++) { for (int j = 0; j < columnCount; j++) { Sparkline item = src.GetSparkline(fromRow + i, fromColumn + j); if (item != null) { item.Row = toRow + i; item.Column = toColumn + j; SparklineGroup group = item.Group; SparklineGroup group2 = group.Clone(); group.Remove(item); if (group.Count <= 0) { src.SheetSparklineGroupManager.Remove(group); } group2.Add(item); this.Add(group2); this.Sheet.SetSparkline(toRow + i, toColumn + j, item); } else { this.Sheet.SetSparkline(toRow + i, toColumn + j, null); } ((ISparklineSheet)src).SetSparkline(fromRow + i, fromColumn + j, null); } } } }