Class WListLevel
Represents a list level.
Implements
Inherited Members
Namespace: Syncfusion.DocIO.DLS
Assembly: Syncfusion.DocIO.Base.dll
Syntax
public class WListLevel : XDLSSerializableBase, IXDLSSerializable
Constructors
WListLevel(ListStyle)
Declaration
public WListLevel(ListStyle listStyle)
Parameters
Type | Name | Description |
---|---|---|
ListStyle | listStyle |
Properties
BulletCharacter
Gets or sets bullet character pattern for the specified list level.
Declaration
public string BulletCharacter { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CharacterFormat
Gets the character formats of list symbol for the specified list level.
Declaration
public WCharacterFormat CharacterFormat { get; }
Property Value
Type | Description |
---|---|
WCharacterFormat |
FollowCharacter
Gets or sets a FollowCharacterType constant that represents the type of character following the number text for the specified list.
Declaration
public FollowCharacterType FollowCharacter { get; set; }
Property Value
Type | Description |
---|---|
FollowCharacterType |
IsLegalStyleNumbering
Gets or sets a value indicating whether to turns all inherited numbers to ArabaicNumberFormat property. The default is false.
Declaration
public bool IsLegalStyleNumbering { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True then the level turns all inherited numbers to arabic; otherwise, false. |
NoRestartByHigher
Gets or sets a value indicating whether to restart the level's number sequence based on higher (more significant) levels in the list.
Declaration
public bool NoRestartByHigher { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True then restart the level's number sequence based on higher (more significant) levels in the list; otherwise, false. |
NumberAlignment
Gets or sets a ListNumberAlignment constant that represents the alignment for the list level of the list template.
Declaration
public ListNumberAlignment NumberAlignment { get; set; }
Property Value
Type | Description |
---|---|
ListNumberAlignment |
NumberPosition
Gets or sets the position (in points) of the number or bullet for the specified list level.
Declaration
public float NumberPosition { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
NumberPrefix
Gets or sets the string inserted before the number for the specified list level.
Declaration
public string NumberPrefix { get; set; }
Property Value
Type | Description |
---|---|
System.String |
NumberSuffix
Gets or sets the string inserted after the number for the specified list level.
Declaration
public string NumberSuffix { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
The following code snippet illustrates how to set the suffix after the number for the specified list level.
private void Button1_Click(System.Object sender, System.EventArgs e)
{
//Creates a new Word document
WordDocument document = new WordDocument();
//Adds new section to the document
IWSection section = document.AddSection();
//Adds new list style to the document
ListStyle listStyle = document.AddListStyle(ListType.Numbered, "UserDefinedList");
WListLevel levelOne = listStyle.Levels[0];
//Defines the follow character, prefix, suffix, start index for level 0
levelOne.FollowCharacter = FollowCharacterType.Tab;
levelOne.NumberPrefix = "(";
levelOne.NumberSuffix = ")";
//Adds new paragraph to the section
IWParagraph paragraph = section.AddParagraph();
//Adds text to the paragraph
paragraph.AppendText("User defined list - Level 0");
//Applies default numbered list style
paragraph.ListFormat.ApplyStyle("UserDefinedList");
//Saves the Word document
document.Save("Sample.docx", FormatType.Docx);
//Closes the document
document.Close();
}
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs)
'Creates a new Word document
Dim document As New WordDocument()
'Adds new section to the document
Dim section As IWSection = document.AddSection()
'Adds new list style to the document
Dim listStyle As ListStyle = document.AddListStyle(ListType.Numbered, "UserDefinedList")
Dim levelOne As WListLevel = listStyle.Levels(0)
'Defines the follow character, prefix, suffix, start index for level 0
levelOne.FollowCharacter = FollowCharacterType.Tab
levelOne.NumberPrefix = "("
levelOne.NumberSuffix = ")"
'Adds new paragraph to the section
Dim paragraph As IWParagraph = section.AddParagraph()
'Adds text to the paragraph
paragraph.AppendText("User defined list - Level 0")
'Applies default numbered list style
paragraph.ListFormat.ApplyStyle("UserDefinedList")
'Saves the Word document
document.Save("Sample.docx", FormatType.Docx)
'Closes the document
document.Close()
End Sub
NumberSufix
Gets or sets the string inserted after the number for the specified list level.
Declaration
[Obsolete("This property has been deprecated. Use the NumberSuffix property of WListLevel class to set/get the suffix after the number for the specified list level.")]
public string NumberSufix { get; set; }
Property Value
Type | Description |
---|---|
System.String |
OwnerListStyle
Gets the owner list style.
Declaration
protected ListStyle OwnerListStyle { get; }
Property Value
Type | Description |
---|---|
ListStyle | The owner list style. |
ParagraphFormat
Gets or sets the paragraph format of the specified list level.
Declaration
public WParagraphFormat ParagraphFormat { get; }
Property Value
Type | Description |
---|---|
WParagraphFormat |
PatternType
Gets or sets a ListPatternType constant that represents the list pattern type for the specified list level.
Declaration
public ListPatternType PatternType { get; set; }
Property Value
Type | Description |
---|---|
ListPatternType |
PreviousLevel
Gets previous list.
Declaration
protected WListLevel PreviousLevel { get; }
Property Value
Type | Description |
---|---|
WListLevel |
StartAt
Gets or sets the starting number for the specified list level.
Declaration
public int StartAt { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
TabSpaceAfter
Gets or or sets the character inserted after the number for the specified list level.
Declaration
public float TabSpaceAfter { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
TextPosition
Gets or sets the position (in points) for the second line of wrapping text for the specified list level.
Declaration
public float TextPosition { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
UsePrevLevelPattern
Gets or sets a value indicating whether to include previous levels for generated number. The default is false.
Declaration
public bool UsePrevLevelPattern { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True number generated will include previous levels; otherwise, false. |
Methods
Clone()
Clones this instance.
Declaration
public WListLevel Clone()
Returns
Type | Description |
---|---|
WListLevel |
CloneImpl()
Clones itself.
Declaration
protected override object CloneImpl()
Returns
Type | Description |
---|---|
System.Object | Returns cloned object. |
Overrides
CreateLayoutData(String, Byte[], Int32)
Create level layout data
Declaration
public void CreateLayoutData(string numStr, byte[] characterOffsets, int levelNumber)
Parameters
Type | Name | Description |
---|---|---|
System.String | numStr | |
System.Byte[] | characterOffsets | |
System.Int32 | levelNumber |
GetListItemText(Int32, ListType)
Gets list symbol for specified item index
Declaration
public string GetListItemText(int listItemIndex, ListType listType)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | listItemIndex | |
ListType | listType |
Returns
Type | Description |
---|---|
System.String |
InitXDLSHolder()
Serialize paragraph and character properties.
Declaration
protected override void InitXDLSHolder()
Overrides
ReadXmlAttributes(IXDLSAttributeReader)
Reads object data from xml attributes.
Declaration
protected override void ReadXmlAttributes(IXDLSAttributeReader reader)
Parameters
Type | Name | Description |
---|---|---|
IXDLSAttributeReader | reader | The IXDLSAttributeReader object. |
Overrides
WriteXmlAttributes(IXDLSAttributeWriter)
Writes object data as xml attributes.
Declaration
protected override void WriteXmlAttributes(IXDLSAttributeWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IXDLSAttributeWriter | writer | The IXDLSAttributeWriter object. |