From d105207f58f574efdf4cb0e46cc802f6694145ed Mon Sep 17 00:00:00 2001 From: Karan-SF4772 Date: Mon, 15 Dec 2025 17:21:53 +0530 Subject: [PATCH 1/2] Modified the existing sample --- .../.NET/Get-heading-list-value/Program.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Paragraphs/Get-heading-list-value/.NET/Get-heading-list-value/Program.cs b/Paragraphs/Get-heading-list-value/.NET/Get-heading-list-value/Program.cs index 32c8a3496..b3d2e2e90 100644 --- a/Paragraphs/Get-heading-list-value/.NET/Get-heading-list-value/Program.cs +++ b/Paragraphs/Get-heading-list-value/.NET/Get-heading-list-value/Program.cs @@ -23,13 +23,11 @@ static void Main(string[] args) Console.WriteLine("No paragraphs with the style 'Heading 3' found."); else { - foreach (Entity paragraph in headingParagraphs) - { - //Get the string that represents the appearance of list value of the paragraph. - if (paragraph is WParagraph) - Console.WriteLine((paragraph as WParagraph).ListString); - else - Console.WriteLine("The entity is not a WParagraph."); + foreach (Entity entity in headingParagraphs) + { + WParagraph paragraph = entity as WParagraph; + //Get the the heading number and the heading text together. + Console.WriteLine(paragraph.ListString + paragraph.Text); } } //Pauses the console to display the output. From df7096ef9fadc0a56aa4dfaecedba084b63e7cdb Mon Sep 17 00:00:00 2001 From: Karan-SF4772 Date: Mon, 15 Dec 2025 17:58:02 +0530 Subject: [PATCH 2/2] Update the comments --- .../.NET/Get-heading-list-value/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Paragraphs/Get-heading-list-value/.NET/Get-heading-list-value/Program.cs b/Paragraphs/Get-heading-list-value/.NET/Get-heading-list-value/Program.cs index b3d2e2e90..9f7c29ffd 100644 --- a/Paragraphs/Get-heading-list-value/.NET/Get-heading-list-value/Program.cs +++ b/Paragraphs/Get-heading-list-value/.NET/Get-heading-list-value/Program.cs @@ -26,7 +26,7 @@ static void Main(string[] args) foreach (Entity entity in headingParagraphs) { WParagraph paragraph = entity as WParagraph; - //Get the the heading number and the heading text together. + //Get the heading number and the heading text together. Console.WriteLine(paragraph.ListString + paragraph.Text); } }