Class
FieldCodeExpression

Represents a field code expression in a document model, allowing for dynamic evaluation of code within fields.

Definition

Namespace:Telerik.Windows.Documents.Model.Fields.CodeExpressions

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public class FieldCodeExpression : FieldNodeWithArgumentBase, IFieldCodeExpressionNode

Inheritance: objectFieldNodeWithArgumentBaseFieldCodeExpression

Implements: IFieldCodeExpressionNode

Inherited Members FieldNodeWithArgumentBase.FieldArgumentNode

Constructors

FieldCodeExpression()

Declaration

cs-api-definition
public FieldCodeExpression()

Properties

FieldTypeNode

Represents a node in the field type expression of a code field in the Telerik document model.

Declaration

cs-api-definition
public FieldTypeNode FieldTypeNode { get; set; }

Property Value

FieldTypeNode

SwitchNodes

Represents the switch nodes in a field code expression, allowing for conditional logic based on the provided cases.

Declaration

cs-api-definition
public List<FieldSwitchNode> SwitchNodes { get; }

Property Value

List<FieldSwitchNode>

Methods

ContainsSwitch(string)

Determines whether the specified string is contained within the field code expression's switch options.

Declaration

cs-api-definition
public bool ContainsSwitch(string switchChars)

Parameters

switchChars

string

The string value to check for presence in the switch options.

Returns

bool

Returns true if the specified string is found in the switch options; otherwise, false.

GetCodeExpressionFragment()

Retrieves the code expression fragment associated with the field code expression.

Declaration

cs-api-definition
public override IEnumerable<Inline> GetCodeExpressionFragment()

Returns

IEnumerable<Inline>

A string representing the code expression fragment.

Overrides FieldNodeWithArgumentBase.GetCodeExpressionFragment()

GetCodeExpressionString()

Retrieves the string representation of the code expression associated with the field.

Declaration

cs-api-definition
public override string GetCodeExpressionString()

Returns

string

A string that represents the code expression. If no valid code expression exists, returns an empty string.

Overrides FieldNodeWithArgumentBase.GetCodeExpressionString()

GetFieldSwitch(string)

Retrieves the field switch associated with the specified field name.

Declaration

cs-api-definition
public FieldSwitchNode GetFieldSwitch(string switchChars)

Parameters

switchChars

string

The name of the field for which the switch is being retrieved.

Returns

FieldSwitchNode

Returns the field switch as a string.

GetSwitchArgument(string)

Retrieves the switch argument for the field code expression based on the provided string input.

Declaration

cs-api-definition
public IFieldArgumentNode GetSwitchArgument(string switchChar)

Parameters

switchChar

string

The string input representing the switch condition.

Returns

IFieldArgumentNode

A value of type IFieldArgumentNode that corresponds to the switch argument for the given input. Returns null if the input does not match any known switch conditions.