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 SourceHideLabel
Gets a value indicating whether to display the associated label.
Declaration
bool HideLabel { get; }
Property Value
Type | Description |
---|---|
System. |
IsReadOnly
Gets a value indicating whether the edited value is read-only.
Declaration
bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System. |
SupportsReadOnly
Gets a value indicating whether the IDataValueEditor supports readonly mode
Declaration
virtual bool SupportsReadOnly { get; }
Property Value
Type | Description |
---|---|
System. |
Validators
Gets the validators to use to validate the edited value.
Declaration
List<IValueValidator> Validators { get; }
Property Value
Type | Description |
---|---|
List<IValue |
Remarks
Use this property to add validators, not to validate. Use Validate(Object, Boolean, String) instead.
TODO: replace with AddValidator? WithValidator?ValueType
Gets the type of the value.
Declaration
string ValueType { get; set; }
Property Value
Type | Description |
---|---|
System. |
Remarks
The value has to be a valid Value
View
Gets the editor view.
Declaration
string View { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
View SourceConvertDbToString(IPropertyType, Object)
Declaration
string ConvertDbToString(IPropertyType propertyType, object value)
Parameters
Type | Name | Description |
---|---|---|
IProperty |
propertyType | |
System. |
value |
Returns
Type | Description |
---|---|
System. |
ConvertDbToXml(IProperty, Boolean)
Used for serializing an IContent item for packaging
Declaration
IEnumerable<XElement> ConvertDbToXml(IProperty property, bool published)
Parameters
Type | Name | Description |
---|---|---|
IProperty | property | |
System. |
published |
Returns
Type | Description |
---|---|
IEnumerable<System. |
ConvertDbToXml(IPropertyType, Object)
Used for serializing an IContent item for packaging
Declaration
XNode ConvertDbToXml(IPropertyType propertyType, object value)
Parameters
Type | Name | Description |
---|---|---|
IProperty |
propertyType | |
System. |
value |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
Content |
editorValue | |
System. |
currentValue |
Returns
Type | Description |
---|---|
System. |
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 | |
System. |
culture | |
System. |
segment |
Returns
Type | Description |
---|---|
System. |
Validate(Object, Boolean, String)
Validates a property value.
Declaration
IEnumerable<ValidationResult> Validate(object value, bool required, string format)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | The property value. |
System. |
required | A value indicating whether the property value is required. |
System. |
format | A specific format (regex) that the property value must respect. |
Returns
Type | Description |
---|---|
IEnumerable<System. |