ApiExamples.ExLists.ListDocument C# (CSharp) Метод

ListDocument() приватный Метод

private ListDocument ( ) : void
Результат void
        public void ListDocument()
        {
            //ExStart
            //ExFor:ListCollection.Document
            //ExFor:ListCollection.Count
            //ExFor:ListCollection.Item(Int32)
            //ExFor:ListCollection.GetListByListId
            //ExFor:List.Document
            //ExFor:List.ListId
            //ExSummary:Illustrates the owner document properties of lists.
            Document doc = new Document();

            ListCollection lists = doc.Lists;
            // All of these should be equal.
            Console.WriteLine("ListCollection document is doc: " + (doc == lists.Document));
            Console.WriteLine("Starting list count: " + lists.Count);

            Aspose.Words.Lists.List list = lists.Add(ListTemplate.BulletDefault);
            Console.WriteLine("List document is doc: " + (list.Document == doc));
            Console.WriteLine("List count after adding list: " + lists.Count);
            Console.WriteLine("Is the first document list: " + (lists[0] == list));
            Console.WriteLine("ListId: " + list.ListId);
            Console.WriteLine("List is the same by ListId: " + (lists.GetListByListId(1) == list));
            //ExEnd

            // Verify these properties
            Assert.AreEqual(doc, lists.Document);
            Assert.AreEqual(doc, list.Document);
            Assert.AreEqual(1, lists.Count);
            Assert.AreEqual(list, lists[0]);
            Assert.AreEqual(1, list.ListId);
            Assert.AreEqual(list, lists.GetListByListId(1));
        }