New to Telerik UI for WPFStart a free 30-day trial

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:

C#
public class FieldCodeExpression : FieldNodeWithArgumentBase, IFieldCodeExpressionNode

Inheritance: objectFieldNodeWithArgumentBaseFieldCodeExpression

Implements: IFieldCodeExpressionNode

Inherited Members FieldNodeWithArgumentBase.FieldArgumentNode

Constructors

C#
public FieldCodeExpression()

Properties

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

C#
public FieldTypeNode FieldTypeNode { get; set; }

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

C#
public List<FieldSwitchNode> SwitchNodes { get; }

Methods

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

C#
public bool ContainsSwitch(string switchChars)
Parameters:switchCharsstring

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.

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

C#
public override IEnumerable<Inline> GetCodeExpressionFragment()
Returns:

IEnumerable<Inline>

A string representing the code expression fragment.

Overrides: FieldNodeWithArgumentBase.GetCodeExpressionFragment()

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

C#
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()

Retrieves the field switch associated with the specified field name.

C#
public FieldSwitchNode GetFieldSwitch(string switchChars)
Parameters:switchCharsstring

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

Returns:

FieldSwitchNode

Returns the field switch as a string.

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

C#
public IFieldArgumentNode GetSwitchArgument(string switchChar)
Parameters:switchCharstring

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.