StyleCollection
Maintains a document's styles by name, registering base and linked styles and resolving style references as styles are added.
Definition
Namespace:Telerik.WinForms.Documents.Model
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class StyleCollection : INotifyCollectionChanged, IEnumerable
Inheritance: objectStyleCollection
Implements:
Constructors
Creates a style repository associated with a document.
public StyleCollection(RadDocument document)
The document that owns the styles.
Properties
Gets the document that owns this style repository.
public RadDocument Document { get; }
Methods
Registers a style and ensures that its base and linked styles are registered as well.
Removes all registered styles, raising collection notifications for the removals.
public void Clear()
Get style from the repository by name.
public StyleDefinition GetValueOrNull(string styleName, bool autoAddBuiltInStyles = true)
Name of the style.
autoAddBuiltInStylesboolTrue to automatically add built in styles into the repository.
Returns:The registered style, including a built-in style added when autoAddBuiltInStyles is true;
otherwise, null if no style is available.
Raises the collection-changed notification.
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
The action and style associated with the collection change.
Removes the named style and also removes its linked style, if present.
Removes a style by its name and also removes its linked style, if present.
Events
Occurs when a style is added to or removed from the repository.
public event NotifyCollectionChangedEventHandler CollectionChanged
Implements: