本文整理汇总了C#中Paragraph.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Paragraph.Clone方法的具体用法?C# Paragraph.Clone怎么用?C# Paragraph.Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paragraph
的用法示例。
在下文中一共展示了Paragraph.Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertWatermarkIntoHeader
private static void InsertWatermarkIntoHeader(Paragraph watermarkPara, Section sect, HeaderFooterType headerType)
{
HeaderFooter header = sect.HeadersFooters[headerType];
if (header == null)
{
// There is no header of the specified type in the current section, create it.
header = new HeaderFooter(sect.Document, headerType);
sect.HeadersFooters.Add(header);
}
// Insert a clone of the watermark into the header.
header.AppendChild(watermarkPara.Clone(true));
}
示例2: UpdateElements
private void UpdateElements(OpenXmlElement root, List<OpenXmlElement> elements, IEnumerable<ProjectFile> projectFiles, Customer customer, User user)
{
foreach (var projectFile in projectFiles)
{
UpdateSingleFile(root, elements, new List<TokensProvider>() {customer, user, projectFile});
#region empty lines
var emptyLineParagraph = new Paragraph() { RsidParagraphAddition = "0077013B", RsidRunAdditionDefault = "00684C81", ParagraphId = "5E06053C", TextId = "77777777" };
var emptyLineRun = new Run();
var emptyLineText = new Text() { Text = String.Empty };
emptyLineRun.Append(emptyLineText);
emptyLineParagraph.Append(emptyLineRun);
root.Append(emptyLineParagraph);
root.Append((OpenXmlElement)emptyLineParagraph.Clone());
#endregion
}
}