private int CleanupTemplateSpace(ExcelWorksheet templateSheet, ExcelWorksheet outputSheet) { ForloopElement templateElement = _forloopElements.First.Value; int rowsToBeDelete = templateElement.GetContentRows(templateSheet) + 2; outputSheet.DeleteRow(templateElement.TemplateAddress.Start.Row, rowsToBeDelete, true); _forloopOffset = -1; return(-rowsToBeDelete); }
public void Add(ForloopElement element) { if (!IsValidTemplateAddress(element)) { throw new InvalidOperationException( "ForloopElements in one collection must have same template address!"); } _forloopElements.AddLast(element); }
public bool IsValidTemplateAddress(ForloopElement element) { return(_forloopElements.All(forloopElement => element.TemplateAddress.Address == forloopElement.TemplateAddress.Address)); }