New to Telerik UI for WinForms? Start a free 30-day trial

Tracks the paragraphs that share a list definition and their numbering state within a document.

Definition

Namespace:Telerik.WinForms.Documents.Lists

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class DocumentList

Inheritance: objectDocumentList

Derived Classes: BulletedListNumberedList

Constructors

Creates a list and sets whether inserting it into another document should create a separate list.

C#
public DocumentList(ListStyle style, RadDocument document, int? id, bool shouldCreateNewDocumentListOnInsert)
Parameters:styleListStyle

The list style used by the list.

documentRadDocument

The owning document, or null to create a detached list.

idint?

The list identifier, or null to let the document assign one.

shouldCreateNewDocumentListOnInsertbool

true to create a distinct list when this list is inserted into another document.

Creates a list with the specified style and attaches it to the document when one is provided.

C#
public DocumentList(ListStyle style, RadDocument document, int? id = null)
Parameters:styleListStyle

The list style used by the list.

documentRadDocument

The owning document, or null to create a detached list.

idint?

The list identifier, or null to let the document assign one.

Properties

Gets the effective style used to format this list. If Style.NumStyleLink is set, the linked numbering style is resolved through the document's list manager when this list is attached to a document. A detached list returns its local Style without resolving the link.

C#
public ListStyle ActualStyle { get; }

Gets or sets the document that owns this list. Assigning a non-null document registers the list with its list manager; after attachment, the document cannot be changed.

C#
public RadDocument Document { get; set; }

Gets the first paragraph currently tracked by this list, or null when the list is empty.

C#
public Paragraph FirstParagraph { get; }

Gets the identifier used by paragraphs to refer to this list.

C#
public int ID { get; }

Gets the number of paragraph entries currently held by this list.

C#
public int ParagraphCount { get; }

Paragraphs

IEnumerable<Paragraph>

Gets the live sequence of paragraph entries currently held by this list.

C#
public IEnumerable<Paragraph> Paragraphs { get; }

Gets the number of actual and temporary paragraphs held by this list.

C#
protected int ParagraphsCount { get; }

Gets or sets the list style registered for this list. Setting a style on a document-owned list registers it with the document's ListManager and requests paragraph measure invalidation when needed.

C#
public ListStyle Style { get; set; }

Gets the identifier of the list style used by this list.

C#
public int StyleId { get; }

Methods

Associates a paragraph with this list at the specified nesting level.

C#
public void AddParagraph(Paragraph paragraph, int listLevel)
Parameters:paragraphParagraph

The paragraph to add to the list.

listLevelint

The nesting level to assign to the paragraph.

Associates a paragraph with this list at level zero.

C#
public void AddParagraph(Paragraph paragraph)
Parameters:paragraphParagraph

The paragraph to add to the list.

Sets every level's indentation in the effective list style to the specified non-negative value.

C#
public void ChangeLeftIndent(double indent)
Parameters:indentdouble

The indentation to apply; negative values are ignored.

Decreases the indentation of every level in the effective list style by one document indent step. No levels are changed if the decrease would make any level's indentation negative.

C#
public void DecreaseLeftIndent()

Finds the list adjacent to the caret paragraph or the first selected paragraph, preferring the previous list after skipping empty non-list paragraphs, then checking the next paragraph.

C#
public static DocumentList GetProperListInfo(RadDocument document)
Parameters:documentRadDocument

The document whose selection and surrounding paragraphs determine the list.

Returns:

DocumentList

The adjacent list, or null if neither side contains a list.

Increases the indentation of every level in the effective list style by one document indent step.

C#
public void IncreaseLeftIndent()

Removes a paragraph from this list and stops tracking its removal events.

C#
public void RemoveParagraph(Paragraph paragraph, bool removingFromOldList = false)
Parameters:paragraphParagraph

The paragraph to remove.

removingFromOldListbool

true when the paragraph is being detached from its previous list, skipping the ownership check.