Stylesheet
Holds style, list-style, and document-list data that can be extracted from or applied to a document.
Definition
Namespace:Telerik.WinForms.Documents.Model.Styles
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class Stylesheet
Inheritance: objectStylesheet
Constructors
Creates an empty stylesheet with version 1.0 and initialized style and list collections.
public Stylesheet()
Properties
Gets or sets the mappings between serialized document-list identifiers and their list styles.
[XamlCompositePropertySerializable]
public List<ListSerializationData> Lists { get; set; }
ListStyles
List<ListStyle>
Gets or sets the list-style definitions referenced by the serialized document lists.
[XamlCompositePropertySerializable]
public List<ListStyle> ListStyles { get; set; }
Styles
List<StyleDefinition>
Gets or sets the style definitions included in the stylesheet.
[XamlCompositePropertySerializable]
public List<StyleDefinition> Styles { get; set; }
Methods
Copies all styles, list styles and other stylesheet data to the specified Document
public void ApplyStylesheetToDocument(RadDocument document)
The document that receives the stylesheet's styles and list data.
Suspends layout updates of RadRichtextBox, which has better performance and uses ApplyStylesheetToDocument(RadDocument) to apply the stylesheet.
public void ApplyStylesheetToRichTextBox(RadRichTextBox richTextBox)
The rich-text box whose document receives the stylesheet.
Copies style definitions from a document, optionally limiting the copied styles with a predicate. Conditional table-style data is populated for the resulting definitions.
protected virtual void CopyStylesFromDocument(RadDocument document, Func<StyleDefinition, bool> filter = null)
The document whose styles are copied.
filterFunc<StyleDefinition, bool>An optional predicate that selects styles to include.
Extracts style definitions and the list data needed to serialize lists used by the document.
When customStylesOnly is true, only custom style definitions are included;
list serialization data is still collected from the document.
public void ExtractStylesheetFromDocument(RadDocument document, bool customStylesOnly = false)
The document to extract from.
customStylesOnlyboolWhether to include only custom style definitions.