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

CodeBasedFieldFactory contains methods for the construction of fields.

Definition

Namespace:Telerik.Windows.Documents.Model

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

C#
public static class CodeBasedFieldFactory

Inheritance: objectCodeBasedFieldFactory

Methods

Creates a field from its field code.

C#
public static CodeBasedField CreateFromFieldCode(string fieldCode)
Parameters:fieldCodestring

The field code.

Returns:

CodeBasedField

Creates a field from a document fragment, containing the field code.

C#
public static CodeBasedField CreateFromFieldFragment(DocumentFragment documentFragment)
Parameters:documentFragmentDocumentFragment

The document fragment, containing the field code.

Returns:

CodeBasedField

Registers the field type in the factory.

C#
public static void RegisterFieldType(CodeBasedField field)
Parameters:fieldCodeBasedField

The field whose type will be registered.

Registers the field type and its corresponding factory method.

C#
public static void RegisterFieldType(string fieldType, Func<CodeBasedField> createFieldFunc)
Parameters:fieldTypestring

The field type name, which can be found in FieldTypeName.

createFieldFuncFunc<CodeBasedField>

The factory method.