public void PropertiesAppliedToInlineFieldShouldPersistAfterSettingContent() { using (var expected = new DocxDocument(Resources.WithStyledInlineSdtElementContentInserted)) using (var document = new DocxDocument(Resources.WithStyledInlineSdtElement)) { var builder = new DocxDocumentBuilder(document); builder.InlineField("InlineField", x => x.Text("Первый").Text("Второй")); Assert.Equal(expected, document, new DocxDocumentEqualityComparer()); } }
public void PropertiesAppliedToInlineFieldInHeadersAndFooters() { using (var expected = new DocxDocument(Resources.FieldsInHeadersAndFootersReplaced)) using (var document = new DocxDocument(Resources.FieldsInHeadersAndFooters)) { var builder = new DocxDocumentBuilder(document); builder.InlineField("Signer.ShortNameThisOrSubstitute", x => x.Text("Первый").Text("Второй")); Assert.Equal(expected, document, new DocxDocumentEqualityComparer()); } }
public void PropertiesAppliedToBlockFieldShouldPersistAfterSettingContent() { using (var expected = new DocxDocument(Resources.WithStyledSdtElementsContentInserted)) using (var document = new DocxDocument(Resources.WithStyledSdtElements)) { var builder = new DocxDocumentBuilder(document); builder.BlockField("BlockField", x => x.Paragraph("Первый").Paragraph("Второй")); Assert.Equal(expected, document, new DocxDocumentEqualityComparer()); } }
public void CanSetContentToInlineFieldConsistingOfTwoRuns() { using (var expected = new DocxDocument(Resources.WithTwoRunsInInlineField)) using (var document = new DocxDocument(Resources.WithSdtElements)) { var builder = new DocxDocumentBuilder(document); builder.InlineField("InlineField", x => x.Text("Первый").Text("Второй")); Assert.Equal(expected, document, new DocxDocumentEqualityComparer()); } }
public void CanSetContentToBlockFieldConsistingOfTwoParagraphs() { using (var expected = new DocxDocument(Resources.WithTwoParagraphsInBlockField)) using (var document = new DocxDocument(Resources.WithSdtElements)) { var builder = new DocxDocumentBuilder(document); builder.BlockField("BlockField", x => x.Paragraph("Первый").Paragraph("Второй")); Assert.Equal(expected, document, new DocxDocumentEqualityComparer()); } }
public byte[] GenerateCardReports(List<Card> cards, List<List> lists) { using (var docxDocument = new DocxDocument(SimpleTemplate.EmptyWordFile)) { var builder = new DocxDocumentBuilder(docxDocument); builder.Tag(SimpleTemplate.HeaderTagName, x => x.Paragraph(z => z.Bold.Text("X. etap - 2012.03.18 - 29 - várható fejlesztések"))); builder.Tag(SimpleTemplate.ContentTagName, x => FoxbyWordServiceHelper.AddHeadline(x, 12).AddReports(cards, lists)); return docxDocument.ToArray(); } }