using System;
using Docs.Word;


namespace SampleManager
{
	class Paragraphs_CreateList
	{
		internal static Document Main1()
		{
			//	Create a new document and get NodeList of first section
			Document Doc = Document.CreateNew();
			NodeList Nodes = Doc.Sections[0].Nodes;

			//	Create a paragraph and make it a first paragraph of new list
			Paragraph Par1 = new Paragraph("Paragraph 1");
			Par1.CreateList(ListStyleEnum.NumberedList, Nodes, -1);

			//	Create a few more paragraphs and insert them in this list
			Paragraph Par2 = new Paragraph("Paragraph 2");
			Par2.InsertInList(Nodes, 0, 0);
			Paragraph Par3 = new Paragraph("Paragraph 3");
			Par3.InsertInList(Nodes, 1, 1);
			Paragraph Par4 = new Paragraph("Paragraph 4");
			Par4.InsertInList(Nodes, 2, 0);

			Nodes.AddParagraph("\r");

			//	Create 2nd list and insert several paragraphs into it
			//	Now we use the shorter and more straigh-forward approach
			new Paragraph("Paragraph 5").CreateList(ListStyleEnum.BulletedList, Nodes, 4);
			new Paragraph("Paragraph 6").InsertInList(Nodes, 5, 0);
			new Paragraph("Paragraph 7").InsertInList(Nodes, 6, 1);
			new Paragraph("Paragraph 8").InsertInList(Nodes, 7, 0);

			return Doc;
		}
	}
}
