GetListByListId
Innehåll
[
Dölj
]ListCollection.GetListByListId method
Hämtar en lista med hjälp av en listidentifierare.
public List GetListByListId(int listId)
Parameter | Typ | Beskrivning |
---|---|---|
listId | Int32 | Listidentifieraren. |
Returvärde
Returnerar listobjektet.null
om en lista med den angivna identifieraren inte hittades.
Anmärkningar
Normalt sett behöver du inte använda den här metoden. För det mesta tillämpar du listformatering på stycken bara genom att ställa inList
property avListFormat
objekt.
Exempel
Visar hur man verifierar egenskaper för ägardokument för listor.
Document doc = new Document();
ListCollection lists = doc.Lists;
Assert.AreEqual(doc, lists.Document);
List list = lists.Add(ListTemplate.BulletDefault);
Assert.AreEqual(doc, list.Document);
Console.WriteLine("Current list count: " + 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)));
Se även
- class List
- class ListCollection
- namnutrymme Aspose.Words.Lists
- hopsättning Aspose.Words