DocumentList
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:
public class DocumentList
Inheritance: objectDocumentList
Derived Classes:
Constructors
Creates a list and sets whether inserting it into another document should create a separate list.
public DocumentList(ListStyle style, RadDocument document, int? id, bool shouldCreateNewDocumentListOnInsert)
The list style used by the list.
documentRadDocumentThe owning document, or null to create a detached list.
idint?The list identifier, or null to let the document assign one.
shouldCreateNewDocumentListOnInsertbooltrue 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.
public DocumentList(ListStyle style, RadDocument document, int? id = null)
The list style used by the list.
documentRadDocumentThe 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.
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.
public RadDocument Document { get; set; }
Gets the first paragraph currently tracked by this list, or null when the list is empty.
public Paragraph FirstParagraph { get; }
Gets the number of paragraph entries currently held by this list.
public int ParagraphCount { get; }
Paragraphs
IEnumerable<Paragraph>
Gets the live sequence of paragraph entries currently held by this list.
public IEnumerable<Paragraph> Paragraphs { get; }
Gets the number of actual and temporary paragraphs held by this list.
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.
public ListStyle Style { get; set; }
Methods
Associates a paragraph with this list at level zero.
public void AddParagraph(Paragraph paragraph)
The paragraph to add to the list.
Sets every level's indentation in the effective list style to the specified non-negative value.
public void ChangeLeftIndent(double indent)
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.
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.
public static DocumentList GetProperListInfo(RadDocument document)
The document whose selection and surrounding paragraphs determine the list.
Returns: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.
public void IncreaseLeftIndent()
Removes a paragraph from this list and stops tracking its removal events.