ListLevel Class |
Namespace: Aspose.Words.Lists
The ListLevel type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | Alignment |
Gets or sets the justification of the actual number of the list item.
|
![]() ![]() | Font |
Specifies character formatting used for the list label.
|
![]() | ImageData |
Returns image data of the picture bullet shape for the current list level.
|
![]() ![]() | IsLegal |
True if the level turns all inherited numbers to Arabic, false if it preserves their number style.
|
![]() ![]() | LinkedStyle |
Gets or sets the paragraph style that is linked to this list level.
|
![]() ![]() | NumberFormat |
Returns or sets the number format for the list level.
|
![]() ![]() | NumberPosition |
Returns or sets the position (in points) of the number or bullet for the list level.
|
![]() ![]() | NumberStyle |
Returns or sets the number style for this list level.
|
![]() ![]() | RestartAfterLevel |
Sets or returns the list level that must appear before the specified list level restarts numbering.
|
![]() ![]() | StartAt |
Returns or sets the starting number for this list level.
|
![]() ![]() | TabPosition |
Returns or sets the tab position (in points) for the list level.
|
![]() ![]() | TextPosition |
Returns or sets the position (in points) for the second line of wrapping text for the list level.
|
![]() ![]() | TrailingCharacter |
Returns or sets the character inserted after the number for the list level.
|
Name | Description | |
---|---|---|
![]() ![]() | CreatePictureBullet |
Creates picture bullet shape for the current list level.
|
![]() ![]() | DeletePictureBullet |
Deletes picture bullet for the current list level.
|
![]() | Equals(Object) | (Inherited from Object.) |
![]() | Equals(ListLevel) |
Compares with the specified ListLevel.
|
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | ToString | (Inherited from Object.) |
You do not create objects of this class. List level objects are created automatically when a list is created. You access ListLevel objects via the ListLevelCollection collection.
Use the properties of ListLevel to specify list formatting for individual list levels.
Document doc = new Document(); // Create a list based on one of the Microsoft Word list templates List list = doc.Lists.Add(ListTemplate.NumberDefault); // Completely customize one list level ListLevel level1 = list.ListLevels[0]; level1.Font.Color = Color.Red; level1.Font.Size = 24; level1.NumberStyle = NumberStyle.OrdinalText; level1.StartAt = 21; level1.NumberFormat = "\x0000"; level1.NumberPosition = -36; level1.TextPosition = 144; level1.TabPosition = 144; // Completely customize yet another list level ListLevel level2 = list.ListLevels[1]; level2.Alignment = ListLevelAlignment.Right; level2.NumberStyle = NumberStyle.Bullet; level2.Font.Name = "Wingdings"; level2.Font.Color = Color.Blue; level2.Font.Size = 24; level2.NumberFormat = "\xf0af"; // A bullet that looks like some sort of a star level2.TrailingCharacter = ListTrailingCharacter.Space; level2.NumberPosition = 144; // Now add some text that uses the list that we created // It does not matter when to customize the list - before or after adding the paragraphs DocumentBuilder builder = new DocumentBuilder(doc); builder.ListFormat.List = list; builder.Writeln("The quick brown fox..."); builder.Writeln("The quick brown fox..."); builder.ListFormat.ListIndent(); builder.Writeln("jumped over the lazy dog."); builder.Writeln("jumped over the lazy dog."); builder.ListFormat.ListOutdent(); builder.Writeln("The quick brown fox..."); builder.ListFormat.RemoveNumbers(); builder.Document.Save(ArtifactsDir + "Lists.CreateCustomList.doc");