Field
Represents a field in the Telerik document model, allowing for the insertion of dynamic content within a document, such as page numbers, dates, or document properties.
Definition
Namespace:Telerik.Windows.Documents.Model
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public abstract class Field : ISupportInitialize
Inheritance: objectField
Derived Classes:
Implements:
Constructors
Fields
protected static readonly string CodeFragmentFormat
protected static readonly string DisplayNameFragmentFormat
Properties
Gets or sets the current display mode of the field.
[XamlSerializable]
public FieldDisplayMode DisplayMode { get; set; }
Gets the document associated with the field.
public RadDocument Document { get; }
Gets the evaluation context of a field.
public EvaluationContext EvaluationContext { get; }
The evaluation context.
Gets the FieldRangeStart instance associated with this field.
public FieldRangeStart FieldStart { get; }
Gets the name of the field type.
public abstract string FieldTypeName { get; }
Gets the value indicating whether the field type has a display name fragment. If it doesn't, when its display mode is set to display name, the result fragment will be used instead.
public virtual bool HasDisplayNameFragment { get; }
Methods
Copies all properties from another field of the same type.
public virtual void CopyPropertiesFrom(Field fromField)
The other field, which has to be of the same type as the current instance.
Creates a deep copy of the field.
Creates a document fragment from a string. The style properties of the elements in the fragment are based on the style properties of the FieldRangeStart and the parent paragraph.
protected DocumentFragment CreateFragmentFromText(string text)
The text to create a fragment from.
Returns:The document fragment.
Creates a new instance of the current field class.
Gets the code fragment of the field.
protected abstract DocumentFragment GetCodeFragment()
The code fragment.
Gets the display name fragment of the field if the field has such.
protected virtual DocumentFragment GetDisplayNameFragment()
The display name fragment.
Gets a fragment of the field corresponding to mode.
public DocumentFragment GetFragmentByDisplayMode(FieldDisplayMode mode)
The display mode.
Returns:The fragment corresponding to the display mode.
Gets one of the fragments of the field on the basis of DisplayMode.
Builds the result fragment of the field.
protected abstract DocumentFragment GetResultFragment()
The result fragment.
Gets the value indicating whether the code in the code fragment is currently valid.
protected abstract bool IsCodeValid()
The value indicating whether the code in the code fragment is currently valid.
Sets the fragment of the field corresponding to mode.
public void SetFragmentByDisplayMode(FieldDisplayMode mode, DocumentFragment fragment)
The display mode.
fragmentDocumentFragmentThe fragment to be set corresponding to the mode.
Sets the value of a specified property for a given Field object.
public void SetPropertyValue(FieldPropertyDefinition propertyDefinition, Field nestedField)
The definition of the property to set.
nestedFieldFieldThe Field object for which the property value is being set.
Sets the value of the specified property for the field.
public void SetPropertyValue(FieldPropertyDefinition propertyDefinition, string value)
The definition of the property to be set.
valuestringThe value to assign to the specified property.
Updates the field. Updates all nested fields and rebuilds the fragments.
public void Update()