Class
StyleRepository

Manages the collection of styles in a document, supporting registration, retrieval, and default style tracking.

Definition

Namespace:Telerik.Windows.Documents.Flow.Model.Styles

Assembly:Telerik.Windows.Documents.Flow.dll

Syntax:

cs-api-definition
public class StyleRepository

Inheritance: objectStyleRepository

Properties

Document

Gets the document that owns this style repository.

Declaration

cs-api-definition
public RadFlowDocument Document { get; }

Property Value

RadFlowDocument

The document.

Styles

Gets all styles currently registered in the repository.

Declaration

cs-api-definition
public IEnumerable<Style> Styles { get; }

Property Value

IEnumerable<Style>

The styles.

Methods

Add(Style)

Registers the specified style in the repository and associates it with this document.

Declaration

cs-api-definition
public void Add(Style style)

Parameters

style

Style

The style.

Exceptions

ArgumentNullException

style is part of another style repository.

AddBuiltInStyle(string)

Creates and registers a built-in style by its identifier; returns the newly added style. Use IDs from BuiltInStyleNames class.

Declaration

cs-api-definition
public Style AddBuiltInStyle(string styleId)

Parameters

styleId

string

The ID of the built-in style.

Returns

Style

The built-in style, added to the repository.

Exceptions

ArgumentException

styleId is not an ID of a built-in style.

Clear()

Unregisters all styles from the repository.

Declaration

cs-api-definition
public void Clear()

Contains(string)

Checks whether a style with the specified identifier exists in the repository.

Declaration

cs-api-definition
public bool Contains(string styleId)

Parameters

styleId

string

The style id.

Returns

bool

true if styleId is found in the StyleRepository; otherwise, false.

GetDefaultStyle(StyleType)

Retrieves the default style for the specified style type, or null if none is registered.

Declaration

cs-api-definition
public Style GetDefaultStyle(StyleType type)

Parameters

type

StyleType

The type.

Returns

Style

The default style or null if such is not present in the repository.

GetStyle(string)

Retrieves the style with the specified identifier, or null if not found.

Declaration

cs-api-definition
public Style GetStyle(string styleId)

Parameters

styleId

string

The style id.

Returns

Style

The style with the given id or null if such is not present in the repository.

Remove(Style)

Unregisters the specified style from the repository.

Declaration

cs-api-definition
public void Remove(Style style)

Parameters

style

Style

The style.

Remove(string)

Unregisters the style with the specified identifier from the repository.

Declaration

cs-api-definition
public void Remove(string styleId)

Parameters

styleId

string

The style id.