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

Stores style-backed formatting values for a document element or a style definition.

Definition

Namespace:Telerik.WinForms.Documents.Model.Styles

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public abstract class DocumentElementPropertiesBase : IElementWithStyle

Inheritance: objectDocumentElementPropertiesBase

Derived Classes: DocumentPropertiesEmptyDocumentElementPropertiesParagraphPropertiesSectionPropertiesSpanPropertiesTableCellPropertiesTablePropertiesTableRowProperties...

Implements: IElementWithStyle

Constructors

Creates a properties container owned by a document element and initializes its registered properties.

C#
public DocumentElementPropertiesBase(DocumentElement owner)
Parameters:ownerDocumentElement

The document element that owns this container.

Creates a properties container owned by a style definition and initializes its registered properties.

C#
public DocumentElementPropertiesBase(StyleDefinition owner)
Parameters:ownerStyleDefinition

The style definition that owns this container.

Properties

Gets whether this container has revision metadata.

C#
public bool HasRevisions { get; }

Gets the original properties snapshot retained for tracked revisions, if one exists.

C#
public DocumentElementPropertiesBase OriginalProperties { get; }

Gets or sets the style name stored with the original properties snapshot used for revisions. Setting a non-empty name marks this container as original properties.

C#
[XamlSerializable("")]
public string OriginalStyleName { get; set; }

Gets or sets the revision metadata associated with this properties container.

C#
public RevisionInfo RevisionInfo { get; set; }

Gets or sets the style definition applied to a document element. Setting the style synchronizes StyleName and notifies non-original document elements of style changes.

C#
public virtual StyleDefinition Style { get; set; }

Implements: IElementWithStyle.Style

Gets or sets the associated style name. For non-original document-element properties, changes are reported to the owning document when available; original revision snapshots suppress that notification. A default style is represented by an empty string.

C#
public string StyleName { get; set; }

Gets the registered properties that belong to this container.

C#
public IEnumerable<StylePropertyBase> StyleProperties { get; }

Methods

Clears the local value of every registered property, allowing inherited or default values to take effect.

C#
public void ClearProperties()

Copies local property values from another container of the same concrete type. Values supplied by styles or parent elements are not copied; revision metadata is copied when present.

C#
public virtual void CopyPropertiesFrom(DocumentElementPropertiesBase fromProperties)
Parameters:fromPropertiesDocumentElementPropertiesBase

The source properties container.

Creates an empty properties container of the same concrete type for revision snapshots.

C#
protected abstract DocumentElementPropertiesBase CreateInstance()
Returns:

DocumentElementPropertiesBase

A new properties container.

Gets the property instance associated with a definition.

C#
public StylePropertyBase GetStyleProperty(IStylePropertyDefinition propertyDefinition)
Parameters:propertyDefinitionIStylePropertyDefinition

The definition used to locate the property.

Returns:

StylePropertyBase

The registered property, or null if this container does not register the definition.

Gets the property instance whose definition has the specified exact name.

C#
public StylePropertyBase GetStyleProperty(string propertyName)
Parameters:propertyNamestring

The property name to locate.

Returns:

StylePropertyBase

The registered property, or null if no definition has that name.

Creates and registers the property instances supported by the concrete container. Called by the base constructors after the owner is assigned.

C#
protected abstract void InitProperties()

Copies local values from the specified container only where this container has no local value. Containers with different concrete types are ignored.

C#
public void MergePropertiesWith(DocumentElementPropertiesBase propertiesToMergeWith)
Parameters:propertiesToMergeWithDocumentElementPropertiesBase

The source properties whose local values may be merged.

Notifies the registered properties and, unless this is an original revision snapshot, the owning document element after the assigned style changes.

C#
protected virtual void OnStyleChanged()

Notifies the registered properties and, unless this is an original revision snapshot, the owning document element before the assigned style changes.

C#
protected virtual void OnStyleChanging()

Lets derived containers respond to property changes in the assigned style. Also called for property differences detected when the assigned style changes.

C#
protected virtual void OnStylePropertyChangedOverride(StylePropertyChangeEventArgs args)
Parameters:argsStylePropertyChangeEventArgs

The changed style property and its old and new values.

Returns a diagnostic representation of the associated style and locally assigned property values.

C#
public override string ToString()
Returns:

string

A string containing style and local-property details.

Overrides: object.ToString()

Validates that the specified style can be assigned to this properties container. The base implementation rejects all styles; derived containers must override it to support styles.

C#
protected virtual void ValidateStyleType(StyleDefinition value)
Parameters:valueStyleDefinition

The style being assigned.

Exceptions: InvalidOperationException

The base implementation does not support styles.