ListCollectionDocument Property

Gets the owner document.

Namespace:  Aspose.Words.Lists
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public DocumentBase Document { get; }

Property Value

Type: DocumentBase
Examples
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);

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].Equals(list)));
Console.WriteLine("ListId: " + list.ListId);
Console.WriteLine("List is the same by ListId: " + (lists.GetListByListId(1).Equals(list)));
See Also