private int GetPageCountInSection(LayoutBox box) { SectionLayoutBox fieldSectionBox = (box as SectionLayoutBox) ?? box.GetCurrentSectionBox(); int pagesNumber = fieldSectionBox.AssociatedSection.GetAssociatedLayoutBoxes().Count(); return(pagesNumber); }
private int GetCurrentPageFromSectionPages(LayoutBox box) { int pageCounter = 1; SectionLayoutBox fieldLayotBox = (box as SectionLayoutBox) ?? box.GetCurrentSectionBox(); foreach (SectionLayoutBox layoutBox in fieldLayotBox.AssociatedSection.GetAssociatedLayoutBoxes()) { if (layoutBox.PageNumber == fieldLayotBox.PageNumber) { break; } pageCounter++; } return(pageCounter); }