Interface IDataValueEditor
Represents an editor for editing data values.
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
public interface IDataValueEditor
Remarks
This is the base interface for parameter and property value editors.
Properties
View SourceIsReadOnly
Gets a value indicating whether the edited value is read-only.
Declaration
bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool |
SupportsReadOnly
Gets a value indicating whether the IDataValueEditor supports readonly mode
Declaration
bool SupportsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Validators
Gets the validators to use to validate the edited value.
Declaration
List<IValueValidator> Validators { get; }
Property Value
| Type | Description |
|---|---|
| List<IValueValidator> |
Remarks
Use this property to add validators, not to validate. Use Validate(object?, bool, string?, PropertyValidationContext) instead.
TODO: replace with AddValidator? WithValidator?ValueType
Gets the type of the value.
Declaration
string ValueType { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
The value has to be a valid ValueTypes value.
Methods
View SourceConfiguredElementTypeKeys()
Declaration
IEnumerable<Guid> ConfiguredElementTypeKeys()
Returns
| Type | Description |
|---|---|
| IEnumerable<Guid> |
ConvertDbToString(IPropertyType, object?)
Declaration
string ConvertDbToString(IPropertyType propertyType, object? value)
Parameters
| Type | Name | Description |
|---|---|---|
| IPropertyType | propertyType | |
| object | value |
Returns
| Type | Description |
|---|---|
| string |
ConvertDbToXml(IProperty, bool)
Used for serializing an IContent item for packaging
Declaration
IEnumerable<XElement> ConvertDbToXml(IProperty property, bool published)
Parameters
| Type | Name | Description |
|---|---|---|
| IProperty | property | |
| bool | published |
Returns
| Type | Description |
|---|---|
| IEnumerable<XElement> |
ConvertDbToXml(IPropertyType, object)
Used for serializing an IContent item for packaging
Declaration
XNode ConvertDbToXml(IPropertyType propertyType, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| IPropertyType | propertyType | |
| object | value |
Returns
| Type | Description |
|---|---|
| XNode |
FromEditor(ContentPropertyData, object?)
Converts a value posted by the editor to a property value.
Declaration
object? FromEditor(ContentPropertyData editorValue, object? currentValue)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentPropertyData | editorValue | |
| object | currentValue |
Returns
| Type | Description |
|---|---|
| object |
ToEditor(IProperty, string?, string?)
Converts a property value to a value for the editor.
Declaration
object? ToEditor(IProperty property, string? culture = null, string? segment = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IProperty | property | |
| string | culture | |
| string | segment |
Returns
| Type | Description |
|---|---|
| object |
Validate(object?, bool, string?, PropertyValidationContext)
Validates a property value.
Declaration
IEnumerable<ValidationResult> Validate(object? value, bool required, string? format, PropertyValidationContext validationContext)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The property value. |
| bool | required | A value indicating whether the property value is required. |
| string | format | A specific format (regex) that the property value must respect. |
| PropertyValidationContext | validationContext | The context in which the property value is being validated. |
Returns
| Type | Description |
|---|---|
| IEnumerable<ValidationResult> |