diff --git a/Examples/ApiExamples/ApiExamples/ExFont.cs b/Examples/ApiExamples/ApiExamples/ExFont.cs index 8e23d9bb..9f09a35a 100644 --- a/Examples/ApiExamples/ApiExamples/ExFont.cs +++ b/Examples/ApiExamples/ApiExamples/ExFont.cs @@ -76,7 +76,7 @@ public void Caps() run.Font.AllCaps = true; para.AppendChild(run); - para = para.ParentNode.AppendChild(new Paragraph(doc)); + para = (Paragraph)para.ParentNode.AppendChild(new Paragraph(doc)); // 2 - Set the SmallCaps flag to display all characters in small capitals: // If a character is lower case, it will appear in its upper case form @@ -201,7 +201,7 @@ public void StrikeThrough() run.Font.StrikeThrough = true; para.AppendChild(run); - para = para.ParentNode.AppendChild(new Paragraph(doc)); + para = (Paragraph)para.ParentNode.AppendChild(new Paragraph(doc)); run = new Run(doc, "Text with a double-line strikethrough."); run.Font.DoubleStrikeThrough = true; @@ -899,7 +899,7 @@ public void ChangeStyle() // Convert all uses of one style to another, // using the above methods to reference old and new styles. - foreach (Run run in doc.GetChildNodes(NodeType.Run, true).OfType()) + foreach (Run run in doc.GetChildNodes(NodeType.Run, true)) { if (run.Font.StyleName == "Emphasis") run.Font.StyleName = "Strong"; @@ -969,7 +969,7 @@ public void Style() builder.Write("This text is in a custom style."); // Iterate over every run and add a double underline to every custom style. - foreach (Run run in doc.GetChildNodes(NodeType.Run, true).OfType()) + foreach (Run run in doc.GetChildNodes(NodeType.Run, true)) { Style charStyle = run.Font.Style; diff --git a/Examples/ApiExamples/ApiExamples/ExPclSaveOptions.cs b/Examples/ApiExamples/ApiExamples/ExPclSaveOptions.cs index 81848dc1..ce89fbc9 100644 --- a/Examples/ApiExamples/ApiExamples/ExPclSaveOptions.cs +++ b/Examples/ApiExamples/ApiExamples/ExPclSaveOptions.cs @@ -85,7 +85,7 @@ public void GetPreservedPaperTrayInformation() // Paper tray information is now preserved when saving document to PCL format. // Following information is transferred from document's model to PCL file. - foreach (Section section in doc.Sections.OfType
()) + foreach (Section section in doc.Sections) { section.PageSetup.FirstPageTray = 15; section.PageSetup.OtherPagesTray = 12; diff --git a/Examples/ApiExamples/ApiExamples/ExSection.cs b/Examples/ApiExamples/ApiExamples/ExSection.cs index 249c19f9..0f98e9ec 100644 --- a/Examples/ApiExamples/ApiExamples/ExSection.cs +++ b/Examples/ApiExamples/ApiExamples/ExSection.cs @@ -503,7 +503,7 @@ public void ModifyPageSetupInAllSections() // It is important to understand that a document can contain many sections, // and each section has its page setup. In this case, we want to modify them all. - foreach (Section section in doc.OfType
()) + foreach (Section section in doc.GetChildNodes(NodeType.Section, true)) section.PageSetup.PaperSize = PaperSize.Letter; doc.Save(ArtifactsDir + "Section.ModifyPageSetupInAllSections.doc"); diff --git a/Examples/ApiExamples/ApiExamples/ExShape.cs b/Examples/ApiExamples/ApiExamples/ExShape.cs index 627a4dde..0c908656 100644 --- a/Examples/ApiExamples/ApiExamples/ExShape.cs +++ b/Examples/ApiExamples/ApiExamples/ExShape.cs @@ -2757,7 +2757,7 @@ public void OfficeMathRenderer() //ExFor:NodeRendererBase.OpaqueBoundsInPoints //ExFor:NodeRendererBase.SizeInPoints //ExFor:OfficeMathRenderer - //ExFor:OfficeMathRenderer.#ctor(Math.OfficeMath) + //ExFor:OfficeMathRenderer.#ctor(OfficeMath) //ExSummary:Shows how to measure and scale shapes. Document doc = new Document(MyDir + "Office math.docx"); diff --git a/Examples/ApiExamples/ApiExamples/ExSmartTag.cs b/Examples/ApiExamples/ApiExamples/ExSmartTag.cs index 395864b8..794d96a6 100644 --- a/Examples/ApiExamples/ApiExamples/ExSmartTag.cs +++ b/Examples/ApiExamples/ApiExamples/ExSmartTag.cs @@ -23,12 +23,12 @@ class ExSmartTag : ApiExampleBase //ExFor:CustomXmlProperty.#ctor(String,String,String) //ExFor:CustomXmlProperty.Name //ExFor:CustomXmlProperty.Value - //ExFor:Markup.SmartTag - //ExFor:Markup.SmartTag.#ctor(DocumentBase) - //ExFor:Markup.SmartTag.Accept(DocumentVisitor) - //ExFor:Markup.SmartTag.Element - //ExFor:Markup.SmartTag.Properties - //ExFor:Markup.SmartTag.Uri + //ExFor:SmartTag + //ExFor:SmartTag.#ctor(DocumentBase) + //ExFor:SmartTag.Accept(DocumentVisitor) + //ExFor:SmartTag.Element + //ExFor:SmartTag.Properties + //ExFor:SmartTag.Uri //ExSummary:Shows how to create smart tags. [Test] //ExSkip public void Create() diff --git a/Examples/ApiExamples/ApiExamples/ExStyles.cs b/Examples/ApiExamples/ApiExamples/ExStyles.cs index 338d6c8c..51f6dd01 100644 --- a/Examples/ApiExamples/ApiExamples/ExStyles.cs +++ b/Examples/ApiExamples/ApiExamples/ExStyles.cs @@ -151,7 +151,7 @@ public void ChangeTocsTabStops() Document doc = new Document(MyDir + "Table of contents.docx"); // Iterate through all paragraphs with TOC result-based styles; this is any style between TOC and TOC9. - foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true).OfType()) + foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true)) if (para.ParagraphFormat.Style.StyleIdentifier >= StyleIdentifier.Toc1 && para.ParagraphFormat.Style.StyleIdentifier <= StyleIdentifier.Toc9) { @@ -168,7 +168,7 @@ public void ChangeTocsTabStops() doc = new Document(ArtifactsDir + "Styles.ChangeTocsTabStops.docx"); - foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true).OfType()) + foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true)) if (para.ParagraphFormat.Style.StyleIdentifier >= StyleIdentifier.Toc1 && para.ParagraphFormat.Style.StyleIdentifier <= StyleIdentifier.Toc9) { diff --git a/Examples/ApiExamples/ApiExamples/ExTable.cs b/Examples/ApiExamples/ApiExamples/ExTable.cs index 5e0e71f2..66b8d3be 100644 --- a/Examples/ApiExamples/ApiExamples/ExTable.cs +++ b/Examples/ApiExamples/ApiExamples/ExTable.cs @@ -279,9 +279,9 @@ private static int GetChildTableCount(Table table) { int childTableCount = 0; - foreach (Row row in table.Rows.OfType()) + foreach (Row row in table.Rows) { - foreach (Cell Cell in row.Cells.OfType()) + foreach (Cell Cell in row.Cells) { TableCollection childTables = Cell.Tables; @@ -686,7 +686,7 @@ public void CloneTable() Assert.AreEqual(3, doc.GetChildNodes(NodeType.Table, true).Count); Assert.AreEqual(table.Range.Text, tableClone.Range.Text); - foreach (Cell cell in tableClone.GetChildNodes(NodeType.Cell, true).OfType()) + foreach (Cell cell in tableClone.GetChildNodes(NodeType.Cell, true)) cell.RemoveAllChildren(); Assert.AreEqual(string.Empty, tableClone.ToString(SaveFormat.Text).Trim()); @@ -706,7 +706,7 @@ public void AllowBreakAcrossPages(bool allowBreakAcrossPages) // in one piece if a table spans two pages, which break up along that row. // If the row is too big to fit in one page, Microsoft Word will push it down to the next page. // Set the "AllowBreakAcrossPages" property to "true" to allow the row to break up across two pages. - foreach (Row row in table.OfType()) + foreach (Row row in table) row.RowFormat.AllowBreakAcrossPages = allowBreakAcrossPages; doc.Save(ArtifactsDir + "Table.AllowBreakAcrossPages.docx"); @@ -786,8 +786,8 @@ public void KeepTableTogether() // Enabling KeepWithNext for every paragraph in the table except for the // last ones in the last row will prevent the table from splitting across multiple pages. - foreach (Cell cell in table.GetChildNodes(NodeType.Cell, true).OfType()) - foreach (Paragraph para in cell.Paragraphs.OfType()) + foreach (Cell cell in table.GetChildNodes(NodeType.Cell, true)) + foreach (Paragraph para in cell.Paragraphs) { Assert.True(para.IsInCell); @@ -801,7 +801,7 @@ public void KeepTableTogether() doc = new Document(ArtifactsDir + "Table.KeepTableTogether.docx"); table = doc.FirstSection.Body.Tables[0]; - foreach (Paragraph para in table.GetChildNodes(NodeType.Paragraph, true).OfType()) + foreach (Paragraph para in table.GetChildNodes(NodeType.Paragraph, true)) if (para.IsEndOfCell && ((Cell)para.ParentNode).ParentRow.IsLastRow) Assert.False(para.ParagraphFormat.KeepWithNext); else @@ -991,8 +991,8 @@ public void CheckCellsMerged() Document doc = new Document(MyDir + "Table with merged cells.docx"); Table table = doc.FirstSection.Body.Tables[0]; - foreach (Row row in table.Rows.OfType()) - foreach (Cell cell in row.Cells.OfType()) + foreach (Row row in table.Rows) + foreach (Cell cell in row.Cells) Console.WriteLine(PrintCellMergeType(cell)); Assert.AreEqual("The cell at R1, C1 is vertically merged", PrintCellMergeType(table.FirstRow.FirstCell)); //ExSkip } @@ -1066,9 +1066,9 @@ public static void MergeCells(Cell startCell, Cell endCell) Math.Abs(endCellPos.X - startCellPos.X) + 1, Math.Abs(endCellPos.Y - startCellPos.Y) + 1); - foreach (Row row in parentTable.Rows.OfType()) + foreach (Row row in parentTable.Rows) { - foreach (Cell cell in row.Cells.OfType()) + foreach (Cell cell in row.Cells) { Point currentPos = new Point(row.IndexOf(cell), parentTable.IndexOf(row));