Class CultureEditor
Inherited Members
Namespace: DataWeb.Data.Controls
Assembly: DataWeb.Core.dll
Syntax
public class CultureEditor : Control
Constructors
CultureEditor(Form, IServiceProvider)
Declaration
public CultureEditor(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
ProcessActionAsync(ContextAction, IUser, string, object, List<ProvidedValue>, NavigationContext, CancellationToken)
Processes a ContextAction triggered on this control. The base implementation returns a successful result without performing any operation. Override to handle control-specific actions.
Declaration
public override Task<ContextAction.Result> ProcessActionAsync(ContextAction action, IUser user, string itemId = null, object value = null, List<Form.ProvidedValue> controlValues = null, NavigationContext navigationContext = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ContextAction | action | The action to perform. |
| IUser | user | The IUser performing the action. |
| string | itemId | The Id of the item being edited, or |
| object | value | The current value of the control at the time the action is triggered, if applicable. |
| List<Form.ProvidedValue> | controlValues | The values of all controls on the form at the time the action is triggered, if applicable. |
| NavigationContext | navigationContext | The NavigationContext of the form, if applicable. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task<ContextAction.Result> | A task that represents the asynchronous operation and returns the action result. |
Overrides
ProcessOnGetValueAsync(object, Dictionary<string, object>, IUser, string, NavigationContext, CancellationToken)
Processes the raw stored value before it is returned to the client. Override to apply transformations such as parsing, formatting, or enrichment. The base implementation returns the value unchanged.
Declaration
public override Task<object> ProcessOnGetValueAsync(object value, Dictionary<string, object> sectionData, IUser user, string itemId = null, NavigationContext navigationContext = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The raw value retrieved from the data store. |
| Dictionary<string, object> | sectionData | The section data associated with the current item. |
| IUser | user | The IUser requesting the value. |
| string | itemId | The Id of the item to which the value belongs, 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. |
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
TranslateAsync(object, CancellationToken)
Declaration
public Task<ContextAction.Result> TranslateAsync(object value, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<ContextAction.Result> |
ValidateAsync(object, List<ProvidedValue>, Dictionary<string, object>, IUser, string, NavigationContext, CancellationToken)
Validates the control value asynchronously. The base implementation checks whether the control is required (via ValidateControlIsRequired(object)) and whether the value matches the declared DataType (via ValidateControlDataType(object)).
Declaration
public override Task<List<ValidationError>> ValidateAsync(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 of the control to validate. |
| 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 submitting 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<List<ValidationError>> | A task that represents the asynchronous operation and returns the list of validation errors, if any. |