Class
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:

cs-api-definition
public abstract class Field : ISupportInitialize

Inheritance: objectField

Derived Classes: CodeBasedField

Implements: ISupportInitialize

Constructors

Field()

Initializes a new instance of the Field class.

Declaration

cs-api-definition
public Field()

Fields

CodeFragmentFormat

Declaration

cs-api-definition
protected static readonly string CodeFragmentFormat

Field Value

string

DisplayNameFragmentFormat

Declaration

cs-api-definition
protected static readonly string DisplayNameFragmentFormat

Field Value

string

Properties

DisplayMode

Gets or sets the current display mode of the field.

Declaration

cs-api-definition
[XamlSerializable]
public FieldDisplayMode DisplayMode { get; set; }

Property Value

FieldDisplayMode

Document

Gets the document associated with the field.

Declaration

cs-api-definition
public RadDocument Document { get; }

Property Value

RadDocument

EvaluationContext

Gets the evaluation context of a field.

Declaration

cs-api-definition
public EvaluationContext EvaluationContext { get; }

Property Value

EvaluationContext

The evaluation context.

FieldStart

Gets the FieldRangeStart instance associated with this field.

Declaration

cs-api-definition
public FieldRangeStart FieldStart { get; }

Property Value

FieldRangeStart

FieldTypeName

Gets the name of the field type.

Declaration

cs-api-definition
public abstract string FieldTypeName { get; }

Property Value

string

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

cs-api-definition
public virtual bool HasDisplayNameFragment { get; }

Property Value

bool

Methods

CopyPropertiesFrom(Field)

Copies all properties from another field of the same type.

Declaration

cs-api-definition
public virtual void CopyPropertiesFrom(Field fromField)

Parameters

fromField

Field

The other field, which has to be of the same type as the current instance.

CreateDeepCopy()

Creates a deep copy of the field.

Declaration

cs-api-definition
public Field CreateDeepCopy()

Returns

Field

The 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

cs-api-definition
protected DocumentFragment CreateFragmentFromText(string text)

Parameters

text

string

The text to create a fragment from.

Returns

DocumentFragment

The document fragment.

CreateInstance()

Creates a new instance of the current field class.

Declaration

cs-api-definition
public abstract Field CreateInstance()

Returns

Field

The new field instance.

GetCodeFragment()

Gets the code fragment of the field.

Declaration

cs-api-definition
protected abstract DocumentFragment GetCodeFragment()

Returns

DocumentFragment

The code fragment.

GetDisplayNameFragment()

Gets the display name fragment of the field if the field has such.

Declaration

cs-api-definition
protected virtual DocumentFragment GetDisplayNameFragment()

Returns

DocumentFragment

The display name fragment.

GetFragmentByDisplayMode(FieldDisplayMode)

Gets a fragment of the field corresponding to mode.

Declaration

cs-api-definition
public DocumentFragment GetFragmentByDisplayMode(FieldDisplayMode mode)

Parameters

mode

FieldDisplayMode

The display mode.

Returns

DocumentFragment

The fragment corresponding to the display mode.

GetFragmentToDisplay()

Gets one of the fragments of the field on the basis of DisplayMode.

Declaration

cs-api-definition
public DocumentFragment GetFragmentToDisplay()

Returns

DocumentFragment

The fragment.

GetResultFragment()

Builds the result fragment of the field.

Declaration

cs-api-definition
protected abstract DocumentFragment GetResultFragment()

Returns

DocumentFragment

The result fragment.

IsCodeValid()

Gets the value indicating whether the code in the code fragment is currently valid.

Declaration

cs-api-definition
protected abstract bool IsCodeValid()

Returns

bool

The value indicating whether the code in the code fragment is currently valid.

IsResultFragmentEmpty()

Declaration

cs-api-definition
protected bool IsResultFragmentEmpty()

Returns

bool

SetFragmentByDisplayMode(FieldDisplayMode, DocumentFragment)

Sets the fragment of the field corresponding to mode.

Declaration

cs-api-definition
public void SetFragmentByDisplayMode(FieldDisplayMode mode, DocumentFragment fragment)

Parameters

mode

FieldDisplayMode

The display mode.

fragment

DocumentFragment

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

cs-api-definition
public void SetPropertyValue(FieldPropertyDefinition propertyDefinition, Field nestedField)

Parameters

propertyDefinition

FieldPropertyDefinition

The definition of the property to set.

nestedField

Field

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

cs-api-definition
public void SetPropertyValue(FieldPropertyDefinition propertyDefinition, string value)

Parameters

propertyDefinition

FieldPropertyDefinition

The definition of the property to be set.

value

string

The value to assign to the specified property.

Update()

Updates the field. Updates all nested fields and rebuilds the fragments.

Declaration

cs-api-definition
public void Update()