Skip to content

Commit 856506c

Browse files
Modified the variable name, XML comments and the contents
1 parent 3f9aeea commit 856506c

File tree

1 file changed

+22
-22
lines changed
  • Paragraphs/Expand-and-collapse-content/Expand-and-collapse-content

1 file changed

+22
-22
lines changed

Paragraphs/Expand-and-collapse-content/Expand-and-collapse-content/Program.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,44 @@
55
WordDocument document = new WordDocument();
66
WSection section = document.AddSection() as WSection;
77

8-
// Add a main heading with Heading 1 style.
8+
// Add a paragraph and append text to it.
99
WParagraph paragraph = section.AddParagraph() as WParagraph;
1010
paragraph.AppendText("The Giant Panda");
11+
// Apply heading level 1.
1112
paragraph.ApplyStyle(BuiltinStyle.Heading1);
12-
13-
// Add a descriptive paragraph following the main heading.
14-
paragraph = section.AddParagraph() as WParagraph;
15-
paragraph.AppendText("The giant panda, which only lives in China outside of captivity, has captured the hearts of people of all ages across the globe. From their furry black and white bodies to their shy and docile nature, they are considered one of the world's most loved animals.");
16-
17-
// Add a subheading under the main section and apply Heading 2 style
18-
paragraph = section.AddParagraph() as WParagraph;
19-
paragraph.AppendText("Opposable Pseudo Thumb");
20-
paragraph.ApplyStyle(BuiltinStyle.Heading2);
21-
22-
// Add a paragraph describing content relevant to the first subheading.
13+
// Add a paragraph and append text to it.
2314
paragraph = section.AddParagraph() as WParagraph;
24-
paragraph.AppendText("A characteristic of the giant panda that has mystified scientists is their movable, elongated wrist bone that acts like an opposable thumb. This human-like quality that helps give them even more of a cuddly-panda appearance enables the giant panda to pick up objects and even eat sitting up.");
15+
paragraph.AppendText("The giant panda, which only lives in China outside of captivity, has captured the hearts of people of all ages across the globe.");
2516

26-
// Add another subheading under the main section and apply Heading 2 style.
17+
// Add a paragraph and append text to it.
2718
paragraph = section.AddParagraph() as WParagraph;
2819
paragraph.AppendText("Small panda or Large Raccoon?");
20+
// Apply heading level 2.
2921
paragraph.ApplyStyle(BuiltinStyle.Heading2);
30-
31-
// Add a paragraph with content relevant to the second subheading.
22+
// Add a paragraph and append text to it.
3223
paragraph = section.AddParagraph() as WParagraph;
33-
paragraph.AppendText("Giant pandas are generally referred to as bears and are typically called panda bears rather than giant pandas.");
24+
paragraph.AppendText("Giant pandas are generally referred to as bears and are typically called panda bears rather than giant pandas.it has several characteristics in common with the red panda.");
3425

35-
// Add a second main heading and apply Heading 1 style.
26+
// Add a paragraph and append text to it.
3627
paragraph = section.AddParagraph() as WParagraph;
3728
paragraph.AppendText("Adventure Works Cycles");
29+
// Apply heading level 1.
3830
paragraph.ApplyStyle(BuiltinStyle.Heading1);
39-
40-
// Add a paragraph with descriptive content for the second main section.
31+
// Add a paragraph and append text to it.
4132
paragraph = section.AddParagraph() as WParagraph;
4233
paragraph.AppendText("Adventure Works Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company.");
4334

35+
// Add a paragraph and append text to it.
36+
paragraph = section.AddParagraph() as WParagraph;
37+
paragraph.AppendText("Product Overview");
38+
// Apply heading level 2.
39+
paragraph.ApplyStyle(BuiltinStyle.Heading2);
40+
// Add a paragraph and append text to it.
41+
paragraph = section.AddParagraph() as WParagraph;
42+
paragraph.AppendText("While its base operation is located in Bothell, Washington with 290 employees, several regional sales teams are located throughout their market base.");
43+
4444
// Save the document.
45-
using (FileStream outputStream1 = new FileStream(Path.GetFullPath(@"Output/Result.docx"), FileMode.OpenOrCreate, FileAccess.ReadWrite))
45+
using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Result.docx"), FileMode.OpenOrCreate, FileAccess.ReadWrite))
4646
{
47-
document.Save(outputStream1, FormatType.Docx);
47+
document.Save(outputStream, FormatType.Docx);
4848
}

0 commit comments

Comments
 (0)