ListLevelFormat Class |
Namespace: GemBox.Document
The ListLevelFormat type exposes the following members.
Name | Description | |
---|---|---|
![]() | Alignment |
Gets or sets the horizontal alignment used on a list level's text specified in the NumberFormat property within a given list level.
|
![]() | AssociatedParagraphStyle |
Gets or sets the ParagraphStyle which shall use this list level when applied to the contents of the document.
|
![]() | BulletPicture |
Gets or sets a picture which shall be used as a list symbol for a given list level.
|
![]() | CharacterFormat |
Gets or sets the character format which shall be applied to the list level's text specified in the NumberFormat property when it is applied to paragraphs in this document.
|
![]() | Document |
Gets the owner document.
(Inherited from Format.) |
![]() | IsLegal |
Gets or sets the value which specifies whether or not all previous levels displayed for a given list level's text specified in the NumberFormat property shall be
displayed using the Decimal (Arabic numerals), regardless of the actual NumberStyle of that level in the list.
|
![]() | Level |
Gets the level of this ListLevelFormat.
|
![]() | NumberFormat |
Gets or sets a value which specifies the textual content which shall be displayed when displaying a paragraph with the given list level.
|
![]() | NumberPosition |
Gets or sets the position (in points) of the number or bullet for the list level.
|
![]() | NumberStyle |
Gets or sets the number style.
|
![]() | ParagraphFormat |
Gets the paragraph format which shall be applied as part of a given list level. This paragraph format is applied to any numbered paragraph that uses this list level.
|
![]() | RestartAfterLevel |
Gets or sets the list level that must appear before the specified list level restarts numbering.
|
![]() | StartAt |
Gets or sets the starting number for this list level.
|
![]() | TextPosition |
Gets or sets the position (in points) of the text.
|
![]() | TrailingCharacter |
Gets or sets the value which specifies the content which shall be added between a given list level's text specified in the NumberFormat property and the text of every numbered paragraph which references that list level.
|
Name | Description | |
---|---|---|
![]() | ClearFormatting |
Clears the formatting.
(Overrides FormatClearFormatting.) |
![]() | Equals |
Determines whether the specified Object is equal to this ListLevelFormat instance.
(Overrides ObjectEquals(Object).) |
![]() | GetHashCode |
Returns a hash code for this ListLevelFormat instance.
(Overrides ObjectGetHashCode.) |
![]() | ToString |
Returns a String that represents this ListLevelFormat instance.
(Overrides ObjectToString.) |
Name | Description | |
---|---|---|
![]() ![]() | Equality |
Determines whether first and second ListLevelFormats are equal.
|
![]() ![]() | Inequality |
Determines whether first and second ListLevelFormats are not equal.
|
List (for example, ordered - with numbers, or unordered - with bullets) appearance in GemBox.Document is defined through ListFormat class that is set on Paragraph's ListFormat property or ParagraphStyle's ListFormat property.
ListFormat is different from other formattings (ParagraphFormat and CharacterFormat) because it doesn't directly contain any formatting properties.
It contains a reference to a ListStyle which exposes ListLevelFormats for every list (indentation) level through its ListLevelFormats property.
ListLevelFormats contain direct formatting properties that affect the appearance of the list. Every ListStyle contains exactly 9 ListLevelFormats, one for each possible list (indentation) level.
Paragraph's list (indentation) level can be adjusted with ListFormat.ListLevelNumber property. Paragraph's list-related formatting will then be collected from the ListLevelFormat instance contained in the ListStyle.ListLevelFormats at the position ListFormat.ListLevelNumber. This ListLevelFormat can also be retrieved from the ListFormat.ListLevelFormat property.
ListLevelFormat retrieved from the ListFormat.ListLevelFormat property can be additionally modified to enable overriding property values of ListLevelFormat instance contained in the ListStyle.ListLevelFormats at the position ListFormat.ListLevelNumber on a Paragraph or ParagraphStyle basis.
To create a list in a document, first ListStyle instance has to be created from one of the predefined list style types specified with ListTemplateType enumeration. After that, ListFormat can be created with a specified ListStyle and assigned to a Paragraph's ListFormat property. For a complete example, see Lists example.
If ListStyle is not referenced from anywhere in the document (from any Paragraph or ParagraphStyle, then it won't be saved to a Word Document (DOCX) file, unless it is added to Styles collection.
Paragraph's list content, which prefixes paragraph content, is represented by ListItem type.
ListItems are not permanently stored in model nor they are written to file formats which fully support ListFormat, instead they are recreated each time CalculateListItems method is called.
If document content or formatting is changed, then CalculateListItems method should be called again to retrieve the latest list items.
For convenience, after calling CalculateListItems method, ListItem can also be retrieved from ListItem property.
After calling Dispose on IEnumeratorT instance retrieved by calling GetEnumerator on instance returned from CalculateListItems method, paragraph's ListItem property will be even if paragraph's IsList is . This enables easy iteration over ListItems returned from CalculateListItems method by using foreach statement and removing all references to ListItems after the iteration is finished.