本文整理汇总了C#中Section.GetChildNodes方法的典型用法代码示例。如果您正苦于以下问题:C# Section.GetChildNodes方法的具体用法?C# Section.GetChildNodes怎么用?C# Section.GetChildNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section.GetChildNodes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitSectionEnd
public override VisitorAction VisitSectionEnd(Section section)
{
if (IsCompositeAcrossPage(section))
{
// If a TOC field spans across more than one page then the hyperlink formatting may show through.
// Remove direct formatting to avoid this.
foreach (FieldStart start in section.GetChildNodes(NodeType.FieldStart, true))
{
if (start.FieldType == FieldType.FieldTOC)
{
Field field = start.GetField();
Node node = field.Separator;
while ((node = node.NextPreOrder(section)) != field.End)
if (node.NodeType == NodeType.Run)
((Run)node).Font.ClearFormatting();
}
}
foreach (Section cloneSection in SplitComposite(section))
{
cloneSection.PageSetup.SectionStart = SectionStart.NewPage;
cloneSection.PageSetup.RestartPageNumbering = true;
cloneSection.PageSetup.PageStartingNumber = section.PageSetup.PageStartingNumber + (section.Document.IndexOf(cloneSection) - section.Document.IndexOf(section));
cloneSection.PageSetup.DifferentFirstPageHeaderFooter = false;
RemovePageBreaksFromParagraph(cloneSection.Body.LastParagraph);
}
RemovePageBreaksFromParagraph(section.Body.LastParagraph);
// Add new page numbering for the body of the section as well.
mPageNumberFinder.AddPageNumbersForNode(section.Body, mPageNumberFinder.GetPage(section), mPageNumberFinder.GetPageEnd(section));
}
return VisitorAction.Continue;
}