New to Telerik UI for WinFormsStart a free 30-day trial

An abstract class representing a document element.

Definition

Namespace:Telerik.WinForms.Documents.Model

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public abstract class DocumentElement : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor

Inheritance: objectDisposableObjectRadObjectDocumentElement

Derived Classes: BlockInlineRadDocument

Implements: ICustomTypeDescriptorIDisposableINotifyPropertyChanged

Inherited Members RadObject.BindingContextPropertyRadObject.RadTypeRadObject.ReplaceDefaultDescriptors(PropertyDescriptorCollection)RadObject.DisposeManagedResources()RadObject.ClearPropertyStore()RadObject.SuspendPropertyNotifications()RadObject.ResumePropertyNotifications()RadObject.GetPropertyValue(RadProperty)RadObject.SetDefaultValueOverride(RadProperty, object)RadObject.GetValue(RadProperty)RadObject.SetValue(RadProperty, object)RadObject.ResetValue(RadProperty)RadObject.ResetLocalValue(RadProperty)RadObject.ResetValue(RadProperty, ValueResetFlags)RadObject.UpdateValue(RadProperty)RadObject.GetValueSource(RadProperty)RadObject.GetRegisteredRadProperty(string)RadObject.UpdateValueCore(RadPropertyValue)RadObject.SetValueCore(RadPropertyValue, object, object, ValueSource)RadObject.ResetValueCore(RadPropertyValue, ValueResetFlags)RadObject.GetDefaultValue(RadPropertyValue, object)RadObject.CoerceValue(RadPropertyValue, object)RadObject.ShouldSerializeProperty(RadProperty)RadObject.CanRaisePropertyChangeNotifications(RadPropertyValue)RadObject.BindProperty(RadProperty, RadObject, RadProperty, PropertyBindingOptions)RadObject.UnbindProperty(RadProperty)RadObject.AddStylePropertySetting(IPropertySetting)RadObject.GetInheritedValue(RadProperty)RadObject.OnPropertyChanging(RadPropertyChangingEventArgs)RadObject.OnPropertyChanged(RadPropertyChangedEventArgs)RadObject.OnNotifyPropertyChanged(string)RadObject.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadObject.OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)RadObject.IsPropertyCancelable(RadPropertyMetadata)RadObject.PropertyValuesRadObject.PropertyFilterRadObject.RadObjectTypeRadObject.BindingContextRadObject.PropertyChangedRadObject.RadPropertyChangedRadObject.RadPropertyChangingDisposableObject.GetBitState(long)DisposableObject.SetBitState(long, bool)DisposableObject.OnBitStateChanged(long, bool, bool)DisposableObject.Dispose()DisposableObject.Dispose(bool)DisposableObject.PerformDispose(bool)DisposableObject.DisposeUnmanagedResources()DisposableObject.BitStateDisposableObject.EventsDisposableObject.IsDisposingDisposableObject.IsDisposedDisposableObject.DisposedDisposableObject.Disposing...

Constructors

Initializes a new instance of the DocumentElement class.

C#
protected DocumentElement()

Properties

Gets the index of the element inside its parent structure.

C#
public int ChildIndex { get; }
Property Value:

The index.

Gets the children.

C#
public DocumentElementCollection Children { get; }
Property Value:

The children.

Gets or sets the cursor image used when the mouse pointer is over the document element.

C#
public virtual Cursor Cursor { get; set; }
Property Value:

The cursor.

Gets the elements representing the children of this document element.

C#
protected DocumentElementCollection DocumentElements { get; }
Property Value:

The document elements.

Represents the first LayoutBox responsible for showing the element.

C#
public LayoutBox FirstLayoutBox { get; }
Property Value:

The first layout box.

Gets a value indicating whether this instance has style.

C#
public bool HasStyle { get; }
Property Value:

true if this instance has style; otherwise, false.

Gets a value indicating whether the FirstLayoutBox is initialized.

C#
protected bool IsFirstLayoutBoxInitialized { get; }
Property Value:

true if this instance is first layout box initialized; otherwise, false.

Gets the next sibling.

C#
public DocumentElement NextSibling { get; }
Property Value:

The next sibling.

Gets the parent.

C#
public DocumentElement Parent { get; }
Property Value:

The parent.

Gets the previous sibling.

C#
public DocumentElement PreviousSibling { get; }
Property Value:

The previous sibling.

Gets or sets the style of the document element.

C#
public virtual StyleDefinition Style { get; set; }
Property Value:

The style.

Gets or sets the name of the style.

C#
[XamlSerializable("")]
public string StyleName { get; set; }
Property Value:

The name of the style.

String property that allows developers to attach custom data to the DocumentElement. The value of this property will be copied to DocumentElements created out of this DocumentElement during editing.

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

Methods

Clears the value of a style property.

C#
public void ClearValue(IStylePropertyDefinition propertyDefinition)
Parameters:propertyDefinitionIStylePropertyDefinition

The property definition.

Copies the properties from another document element.

C#
public void CopyPropertiesFrom(DocumentElement fromElement)
Parameters:fromElementDocumentElement

The element to copy the properties from.

Exceptions:

NullReferenceException

fromElement must not be null.

InvalidOperationException

Cannot copy properties to element itself.

Copies the properties from another document element to the current instance.

C#
protected abstract void CopyPropertiesFromOverride(DocumentElement fromElement)
Parameters:fromElementDocumentElement

The DocumentElement to copy the properties from.

Copies the properties from a specified style.

C#
public void CopyPropertiesFromStyle(StyleDefinition style)
Parameters:styleStyleDefinition

The style to copy the properties from.

Creates a deep copy of the element.

C#
public virtual DocumentElement CreateDeepCopy()
Returns:

DocumentElement

The copied element.

Creates a LayoutBox for the document element.

C#
protected LayoutBox CreateLayoutBox()
Returns:

LayoutBox

The created LayoutBox.

Creates a LayoutBox for the element.

C#
public abstract LayoutBox CreateLayoutBox(DocumentStructureCollection documentCollection)
Parameters:documentCollectionDocumentStructureCollection

The document collection.

Returns:

LayoutBox

Creates a new instance of this element.

C#
protected abstract DocumentElement CreateNewElementInstance()
Returns:

DocumentElement

The new instance.

Creates a shallow copy of the element.

C#
public virtual DocumentElement CreateShallowCopy()
Returns:

DocumentElement

The copied element.

Iterates through the children of the document element.

C#
public IEnumerable<T> EnumerateChildrenOfType<T>() where T : DocumentElement
Returns:

IEnumerable<T>

A collection of all the child elements of the specified type.

Extracts a style from the local properties of the element.

C#
public StyleDefinition ExtractStyleFromLocalProperties()
Returns:

StyleDefinition

A StyleDefinition instance created from the element's local properties.

Extracts a style from the style properties of the element.

C#
public StyleDefinition ExtractStyleFromProperties()
Returns:

StyleDefinition

A StyleDefinition instance created from the element's style properties.

Gets the LayoutBoxes associated to the element.

C#
public IEnumerable<LayoutBox> GetAssociatedLayoutBoxes()
Returns:

IEnumerable<LayoutBox>

Collection of the layout boxes associated to the element.

Iterates through the parent elements of the document element and returns the first occurence of a parent of the specified type.

C#
public T GetParentOfType<T>() where T : DocumentElement
Returns:

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.

C#
public RadValueSource GetPropertyValueSource(IStylePropertyDefinition propertyDefinition)
Parameters:propertyDefinitionIStylePropertyDefinition

The property definition.

Returns:

RadValueSource

A RadValueSource representing the source of the value.

Gets the RadDocument instance associated to the element.

C#
public RadDocument GetRootDocument()
Returns:

RadDocument

Gets a style property from a specified definition.

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

The property definition.

Returns:

StylePropertyBase

The style property.

Gets a style property by name.

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

The name of the property.

Returns:

StylePropertyBase

The style property.

Invalidates the arrange of the layout boxes associated to this element.

C#
protected void InvalidateAssociatedBoxesArrange()

Invalidates the layout of the layout boxes associated to this element.

C#
public void InvalidateAssociatedBoxesLayout()

Invalidates the measure of the layout boxes associated to this element.

C#
protected void InvalidateAssociatedBoxesMeasure()

Called when the parent of the element has been changed.

C#
protected virtual void OnParentChanged()

Called when the parent of the element is changing.

C#
protected virtual void OnParentChanging()

Called when a DocumentElement is removed.

C#
protected virtual void OnRemoved()

Called after the style of a document element has been changed.

C#
protected virtual void OnStyleChanged()

Called before the style of a document element changes.

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

Events

Occurs after changing the parent of the element.

C#
public event EventHandler ParentChanged

Occurs before changing the parent of the element.

C#
public event EventHandler ParentChanging

Occurs after changing the value of a property.

C#
public event StylePropertyChangeEventHandler PropertyValueChanged

Called after the style of a document element has been changed.

C#
public event EventHandler StyleChanged

Called before the style of a document element changes.

C#
public event EventHandler StyleChanging

Called after the style of a document element has been changed.

C#
public event StylePropertyChangeEventHandler StylePropertyChanged