ClassField
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
CodeFragmentFormat
Declaration
protected static readonly string CodeFragmentFormat
Field Value
DisplayNameFragmentFormat
Declaration
protected static readonly string DisplayNameFragmentFormat
Field Value
Properties
DisplayMode
Gets or sets the current display mode of the field.
Declaration
[XamlSerializable]
public FieldDisplayMode DisplayMode { get; set; }
Property Value
Document
Gets the document associated with the field.
EvaluationContext
Gets the evaluation context of a field.
Declaration
public EvaluationContext EvaluationContext { get; }
Property Value
The evaluation context.
FieldStart
Gets the FieldRangeStart instance associated with this field.
Declaration
public FieldRangeStart FieldStart { get; }
Property Value
FieldTypeName
Gets the name of the field type.
HasDisplayNameFragment
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.
Declaration
public virtual bool HasDisplayNameFragment { get; }
Property Value
Methods
CopyPropertiesFrom(Field)
Copies all properties from another field of the same type.
Declaration
public virtual void CopyPropertiesFrom(Field fromField)
Parameters
fromField
The other field, which has to be of the same type as the current instance.
CreateDeepCopy()
Creates a deep copy of the field.
CreateFragmentFromText(string)
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.
Declaration
protected DocumentFragment CreateFragmentFromText(string text)
Parameters
text
The text to create a fragment from.
Returns
The document fragment.
CreateInstance()
Creates a new instance of the current field class.
Declaration
public abstract Field CreateInstance()
Returns
The new field instance.
GetCodeFragment()
Gets the code fragment of the field.
Declaration
protected abstract DocumentFragment GetCodeFragment()
Returns
The code fragment.
GetDisplayNameFragment()
Gets the display name fragment of the field if the field has such.
Declaration
protected virtual DocumentFragment GetDisplayNameFragment()
Returns
The display name fragment.
GetFragmentByDisplayMode(FieldDisplayMode)
Gets a fragment of the field corresponding to mode.
Declaration
public DocumentFragment GetFragmentByDisplayMode(FieldDisplayMode mode)
Parameters
mode
The display mode.
Returns
The fragment corresponding to the display mode.
GetFragmentToDisplay()
Gets one of the fragments of the field on the basis of DisplayMode.
Declaration
public DocumentFragment GetFragmentToDisplay()
Returns
The fragment.
GetResultFragment()
Builds the result fragment of the field.
Declaration
protected abstract DocumentFragment GetResultFragment()
Returns
The result fragment.
IsCodeValid()
Gets the value indicating whether the code in the code fragment is currently valid.
Declaration
protected abstract bool IsCodeValid()
Returns
The value indicating whether the code in the code fragment is currently valid.
SetFragmentByDisplayMode(FieldDisplayMode, DocumentFragment)
Sets the fragment of the field corresponding to mode.
Declaration
public void SetFragmentByDisplayMode(FieldDisplayMode mode, DocumentFragment fragment)
Parameters
mode
The display mode.
fragment
The fragment to be set corresponding to the mode.
SetPropertyValue(FieldPropertyDefinition, Field)
Sets the value of a specified property for a given Field object.
Declaration
public void SetPropertyValue(FieldPropertyDefinition propertyDefinition, Field nestedField)
Parameters
propertyDefinition
The definition of the property to set.
nestedField
The Field object for which the property value is being set.
SetPropertyValue(FieldPropertyDefinition, string)
Sets the value of the specified property for the field.
Declaration
public void SetPropertyValue(FieldPropertyDefinition propertyDefinition, string value)
Parameters
propertyDefinition
The definition of the property to be set.
value
The value to assign to the specified property.
Update()
Updates the field. Updates all nested fields and rebuilds the fragments.
Declaration
public void Update()