Class TextEditorClassic
Inherited Members
Namespace: DataWeb.Data.Controls
Assembly: DataWeb.Core.dll
Syntax
public class TextEditorClassic : Control
Constructors
TextEditorClassic(Form, IServiceProvider)
Declaration
public TextEditorClassic(Form form, IServiceProvider serviceProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| Form | form | |
| IServiceProvider | serviceProvider |
Methods
InitAsync(CancellationToken)
Initializes the control asynchronously. Override to register actions and events.
Declaration
public override Task InitAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous initialization operation. |
Overrides
ProcessOnSaveDataAsync(object, List<ProvidedValue>, Dictionary<string, object>, IUser, string, NavigationContext, CancellationToken)
Processes and sanitizes the control value before it is persisted. Override to apply
transformations such as parsing, formatting, or storage-specific encoding.
The base implementation strips HTML from String values via SanitizeControlValue(object).
Declaration
public override Task<object> ProcessOnSaveDataAsync(object value, List<Form.ProvidedValue> providedValues, Dictionary<string, object> sectionData, IUser user, string itemId = null, NavigationContext navigationContext = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The value submitted for this control. |
| List<Form.ProvidedValue> | providedValues | All values provided for the form submission. |
| Dictionary<string, object> | sectionData | The section data associated with the current item. |
| IUser | user | The IUser saving the form. |
| string | itemId | The Id of the item being edited, or |
| NavigationContext | navigationContext | The NavigationContext of the form, if applicable. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task<object> | A task that represents the asynchronous operation and returns the processed value to persist. |
Overrides
ProcessOnTranslateAsync(object, Dictionary<string, string>, Dictionary<string, object>, string, string, IUser, string, NavigationContext, CancellationToken)
Processes the control value during a translation operation. Override to apply culture-specific transformations. The base implementation returns the value unchanged.
Declaration
public override Task<object> ProcessOnTranslateAsync(object value, Dictionary<string, string> translatedValues, Dictionary<string, object> sectionData, string culture, string sourceCulture, IUser user, string itemId = null, NavigationContext navigationContext = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The value to process. |
| Dictionary<string, string> | translatedValues | A dictionary of already-translated values keyed by field name. |
| Dictionary<string, object> | sectionData | The section data associated with the current item. |
| string | culture | The target culture (e.g. |
| string | sourceCulture | The source culture from which the translation originates. |
| IUser | user | The IUser performing the translation. |
| string | itemId | The Id of the item being translated, if applicable. |
| NavigationContext | navigationContext | The NavigationContext, if applicable. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task<object> | A task that represents the asynchronous operation and returns the processed value. |