DocumentElement
An abstract class representing a document element.
Definition
Namespace:Telerik.WinForms.Documents.Model
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public abstract class DocumentElement : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor
Inheritance: objectDisposableObjectRadObjectDocumentElement
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the DocumentElement class.
protected DocumentElement()
Properties
Gets the index of the element inside its parent structure.
public int ChildIndex { get; }
The index.
Gets the children.
public DocumentElementCollection Children { get; }
The children.
Gets or sets the cursor image used when the mouse pointer is over the document element.
public virtual Cursor Cursor { get; set; }
The cursor.
Gets the elements representing the children of this document element.
protected DocumentElementCollection DocumentElements { get; }
The document elements.
Represents the first LayoutBox responsible for showing the element.
public LayoutBox FirstLayoutBox { get; }
The first layout box.
Gets a value indicating whether this instance has style.
public bool HasStyle { get; }
true if this instance has style; otherwise, false.
Gets a value indicating whether the FirstLayoutBox is initialized.
protected bool IsFirstLayoutBoxInitialized { get; }
true if this instance is first layout box initialized; otherwise, false.
Gets the next sibling.
public DocumentElement NextSibling { get; }
The next sibling.
Gets the parent.
public DocumentElement Parent { get; }
The parent.
Gets the previous sibling.
public DocumentElement PreviousSibling { get; }
The previous sibling.
Gets or sets the style of the document element.
public virtual StyleDefinition Style { get; set; }
The style.
Gets or sets the name of the style.
[XamlSerializable("")]
public string StyleName { get; set; }
The name of the style.
Methods
Clears the value of a style property.
public void ClearValue(IStylePropertyDefinition propertyDefinition)
The property definition.
Copies the properties from another document element.
public void CopyPropertiesFrom(DocumentElement fromElement)
The element to copy the properties from.
Exceptions:fromElement must not be null.
Cannot copy properties to element itself.
Copies the properties from another document element to the current instance.
protected abstract void CopyPropertiesFromOverride(DocumentElement fromElement)
The DocumentElement to copy the properties from.
Copies the properties from a specified style.
public void CopyPropertiesFromStyle(StyleDefinition style)
The style to copy the properties from.
Creates a deep copy of the element.
Creates a LayoutBox for the element.
public abstract LayoutBox CreateLayoutBox(DocumentStructureCollection documentCollection)
The document collection.
Returns:Creates a new instance of this element.
protected abstract DocumentElement CreateNewElementInstance()
The new instance.
Creates a shallow copy of the element.
Iterates through the children of the document element.
public IEnumerable<T> EnumerateChildrenOfType<T>() where T : DocumentElement
IEnumerable<T>
A collection of all the child elements of the specified type.
Extracts a style from the local properties of the element.
public StyleDefinition ExtractStyleFromLocalProperties()
A StyleDefinition instance created from the element's local properties.
Extracts a style from the style properties of the element.
public StyleDefinition ExtractStyleFromProperties()
A StyleDefinition instance created from the element's style properties.
Iterates through the parent elements of the document element and returns the first occurence of a parent of the specified type.
public T GetParentOfType<T>() where T : DocumentElement
T
The first parent of the specified type, or null if the element doesn't have parent.
Gets the source of the value of a specified property.
public RadValueSource GetPropertyValueSource(IStylePropertyDefinition propertyDefinition)
The property definition.
Returns:A RadValueSource representing the source of the value.
Gets the RadDocument instance associated to the element.
Gets a style property from a specified definition.
public StylePropertyBase GetStyleProperty(IStylePropertyDefinition propertyDefinition)
The property definition.
Returns:The style property.
Gets a style property by name.
public StylePropertyBase GetStyleProperty(string propertyName)
The name of the property.
Returns:The style property.
Invalidates the arrange of the layout boxes associated to this element.
protected void InvalidateAssociatedBoxesArrange()
Invalidates the layout of the layout boxes associated to this element.
public void InvalidateAssociatedBoxesLayout()
Invalidates the measure of the layout boxes associated to this element.
protected void InvalidateAssociatedBoxesMeasure()
Called when the parent of the element has been changed.
protected virtual void OnParentChanged()
Called when the parent of the element is changing.
protected virtual void OnParentChanging()
Called when a DocumentElement is removed.
protected virtual void OnRemoved()
Called after the style of a document element has been changed.
protected virtual void OnStyleChanged()
Called before the style of a document element changes.
protected virtual void OnStyleChanging()
protected virtual void OnStylePropertyChanged(StylePropertyChangeEventArgs args)
Events
Occurs after changing the parent of the element.
public event EventHandler ParentChanged
Occurs before changing the parent of the element.
public event EventHandler ParentChanging
Occurs after changing the value of a property.
public event StylePropertyChangeEventHandler PropertyValueChanged
Called after the style of a document element has been changed.
public event EventHandler StyleChanged
Called before the style of a document element changes.
public event EventHandler StyleChanging
Called after the style of a document element has been changed.
public event StylePropertyChangeEventHandler StylePropertyChanged