FieldCodeBuilder
Builds a field-code expression from a field type, an optional argument, and ordered switches.
Definition
Namespace:Telerik.WinForms.Documents.Model.Fields.CodeExpressions
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class FieldCodeBuilder
Inheritance: objectFieldCodeBuilder
Constructors
Creates a builder initialized with the specified field type.
public FieldCodeBuilder(string fieldType)
The field type identifier written at the start of the code.
Exceptions: ArgumentExceptionfieldType is null or empty.
Methods
Adds a switch with the value of a field property as its argument. An empty literal property value omits the switch; a nested field is retained as a nested argument.
public void AddSwitch(string switchCharacters, FieldProperty prop)
The switch token, including its leading backslash.
propFieldPropertyThe property supplying the switch argument.
Adds a switch that has no argument.
public void AddSwitch(string switchCharacters)
The switch token, including its leading backslash.
Gets the code expression as inline elements, including the surrounding field delimiters.
public IEnumerable<Inline> GetCodeExpressionFragment()
IEnumerable<Inline>
The inline representation of the code expression.
Gets the field-code text without the surrounding field delimiters.
public string GetResultCode()
The field type, argument, and switches joined as code text.
Clears the current argument and switches and restores the builder's original field type.
public void Reset()
Sets the field's argument from a property, retaining nested fields as nested arguments. An empty literal value clears the argument.
public void SetFieldArgument(FieldProperty prop)
The property supplying the field argument.