GetListByListId
Contents
[
Hide
]ListCollection.GetListByListId method
Gets a list by a list identifier.
public List GetListByListId(int listId)
| Parameter | Type | Description |
|---|---|---|
| listId | Int32 | The list identifier. |
Return Value
Returns the list object. Returns null if a list with the specified identifier was not found.
Remarks
You don’t normally need to use this method. Most of the time you apply list formatting to paragraphs just by settings the List property of the ListFormat object.
Examples
Shows how to verify owner document properties of lists.
Document doc = new Document();
ListCollection lists = doc.Lists;
Assert.That(lists.Document, Is.EqualTo(doc));
List docList = lists.Add(ListTemplate.BulletDefault);
Assert.That(docList.Document, Is.EqualTo(doc));
Console.WriteLine("Current list count: " + lists.Count);
Console.WriteLine("Is the first document list: " + (lists[0].Equals(docList)));
Console.WriteLine("ListId: " + docList.ListId);
Console.WriteLine("List is the same by ListId: " + (lists.GetListByListId(1).Equals(docList)));
See Also
- class List
- class ListCollection
- namespace Aspose.Words.Lists
- assembly Aspose.Words