New to Telerik UI for WinForms? Start a free 30-day trial

Represents a field type, its optional argument, and its ordered switch nodes.

Definition

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

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class FieldCodeExpression : FieldNodeWithArgumentBase, IFieldCodeExpressionNode

Inheritance: objectFieldNodeWithArgumentBaseFieldCodeExpression

Implements: IFieldCodeExpressionNode

Inherited Members FieldNodeWithArgumentBase.FieldArgumentNode

Constructors

Creates an expression with an empty switch list and no field type or argument.

C#
public FieldCodeExpression()

Properties

Gets or sets the node that supplies the field type token.

C#
public FieldTypeNode FieldTypeNode { get; set; }

Gets the switches that follow the field argument, in their code order.

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

Methods

Determines whether a switch with the exact specified token is present.

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

The switch token to find, including its leading backslash.

Returns:

bool

true when a matching switch exists; otherwise, false.

Gets inline elements for the expression, including its opening and closing field delimiters.

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

IEnumerable<Inline>

The inline representation of the expression.

Overrides: FieldNodeWithArgumentBase.GetCodeExpressionFragment()

Gets the code text for the field type, optional argument, and switches, without surrounding field delimiters.

C#
public override string GetCodeExpressionString()
Returns:

string

The field-code text.

Overrides: FieldNodeWithArgumentBase.GetCodeExpressionString()

Gets the first switch whose token exactly matches switchChars.

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

The switch token to find, including its leading backslash.

Returns:

FieldSwitchNode

The matching switch, or null if none is present.

Gets the argument attached to a switch.

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

The switch token to search for, including its leading backslash.

Returns:

IFieldArgumentNode

The switch argument, or null if the switch is absent or has no argument.