Пример #1
0
        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);
        }
Пример #2
0
        public void Add(ForloopElement element)
        {
            if (!IsValidTemplateAddress(element))
            {
                throw new InvalidOperationException(
                          "ForloopElements in one collection must have same template address!");
            }

            _forloopElements.AddLast(element);
        }
Пример #3
0
 public bool IsValidTemplateAddress(ForloopElement element)
 {
     return(_forloopElements.All(forloopElement =>
                                 element.TemplateAddress.Address == forloopElement.TemplateAddress.Address));
 }