Class
CodeBasedField

Represents a code-based field in the Telerik Windows Documents Model.

Definition

Namespace:Telerik.Windows.Documents.Model

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public abstract class CodeBasedField : Field, ISupportInitialize

Inheritance: objectFieldCodeBasedField

Derived Classes: AuthorFieldBibliographyFieldCitationFieldDateFieldDocumentVariableFieldHyperlinkFieldIncludePictureFieldMergeFieldNotSupportedFieldNumPagesFieldPageFieldReferenceFieldBaseSequentialFieldStyleReferenceFieldSymbolFieldTCFieldTableOfContentsField

Implements: ISupportInitialize

Inherited Members Field.CodeFragmentFormatField.DisplayNameFragmentFormatField.GetFragmentToDisplay()Field.GetFragmentByDisplayMode(FieldDisplayMode)Field.SetFragmentByDisplayMode(FieldDisplayMode, DocumentFragment)Field.CreateInstance()Field.Update()Field.CreateFragmentFromText(string)Field.GetDisplayNameFragment()Field.GetResultFragment()Field.CreateDeepCopy()Field.SetPropertyValue(FieldPropertyDefinition, string)Field.SetPropertyValue(FieldPropertyDefinition, Field)Field.IsResultFragmentEmpty()Field.HasDisplayNameFragmentField.FieldTypeNameField.FieldStartField.DisplayModeField.EvaluationContextField.Document

Constructors

CodeBasedField()

Initializes a new instance of the CodeBasedField class.

Declaration

cs-api-definition
public CodeBasedField()

Fields

DateTimeFormattingProperty

The date time formatting.

Declaration

cs-api-definition
public static readonly FieldPropertyDefinition DateTimeFormattingProperty

Field Value

FieldPropertyDefinition

GeneralFormattingProperty

The general formatting.

Declaration

cs-api-definition
public static readonly FieldPropertyDefinition GeneralFormattingProperty

Field Value

FieldPropertyDefinition

NumericFormattingProperty

The numeric formatting.

Declaration

cs-api-definition
public static readonly FieldPropertyDefinition NumericFormattingProperty

Field Value

FieldPropertyDefinition

Properties

CodeBuilder

Gets the FieldCodeBuilder used to create the code fragment of the field.

Declaration

cs-api-definition
protected FieldCodeBuilder CodeBuilder { get; }

Property Value

FieldCodeBuilder

DateTimeFormatting

Represents the formatting options for a DateTime field in a document model.

Declaration

cs-api-definition
[XamlSerializable]
public string DateTimeFormatting { get; set; }

Property Value

string

FieldCode

Gets the code of the field.

Declaration

cs-api-definition
public string FieldCode { get; }

Property Value

string

GeneralFormatting

Represents the general formatting for code-based fields in the Telerik document model.

Declaration

cs-api-definition
[XamlSerializable]
public string GeneralFormatting { get; set; }

Property Value

string

NumericFormatting

/// Represents the numeric formatting options for code-based fields in Telerik documents.

Declaration

cs-api-definition
[XamlSerializable]
public string NumericFormatting { get; set; }

Property Value

string

Methods

BuildCodeOverride()

Builds the field-specific parts of the code fragment, using the current CodeBuilder.

Declaration

cs-api-definition
protected virtual void BuildCodeOverride()

CopyPropertiesFrom(Field)

Copies all properties from another field of the same type.

Declaration

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

Parameters

fromField

Field

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

Overrides Field.CopyPropertiesFrom(Field)

CopyPropertiesFrom(FieldCodeExpression)

Copies the properties of the field from a FieldCodeExpression instance.

Declaration

cs-api-definition
public void CopyPropertiesFrom(FieldCodeExpression fieldCodeExpression)

Parameters

fieldCodeExpression

FieldCodeExpression

The field code expression.

CopyPropertiesFromCodeExpression(FieldCodeExpression)

Copies the field-specific properties from a FieldCodeExpression.

Declaration

cs-api-definition
protected virtual void CopyPropertiesFromCodeExpression(FieldCodeExpression fieldCodeExpression)

Parameters

fieldCodeExpression

FieldCodeExpression

The field code expression.

GetCodeFragment()

Gets the code fragment of the field. If the code is currently not valid, it will be rebuilt.

Declaration

cs-api-definition
protected override DocumentFragment GetCodeFragment()

Returns

DocumentFragment

The code fragment

Overrides Field.GetCodeFragment()

GetNumberResultWithFormatting(int)

Declaration

cs-api-definition
protected string GetNumberResultWithFormatting(int number)

Parameters

number

int

Returns

string

InvalidateCode()

Invalidates the code fragment of the field. The next time the code fragment is requested, it will be built anew.

Declaration

cs-api-definition
protected void InvalidateCode()

IsCodeValid()

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

Declaration

cs-api-definition
protected override bool IsCodeValid()

Returns

bool

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

Overrides Field.IsCodeValid()

MakeHyperlinkFragment(DocumentFragment, HyperlinkInfo)

Declaration

cs-api-definition
protected DocumentFragment MakeHyperlinkFragment(DocumentFragment fragment, HyperlinkInfo hyperlinkInfo)

Parameters

fragment

DocumentFragment

hyperlinkInfo

HyperlinkInfo

Returns

DocumentFragment