Interface IDataValueEditor
Represents an editor for editing data values.
Namespace: Umbraco.Core.PropertyEditors
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.Boolean |
IsReadOnly
Gets a value indicating whether the edited value is read-only.
Declaration
bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Validators
Gets the validators to use to validate the edited value.
Declaration
List<IValueValidator> Validators { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<IValueValidator> |
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.String |
Remarks
The value has to be a valid ValueTypes value.
View
Gets the editor view.
Declaration
string View { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
View SourceConvertDbToString(PropertyType, Object, IDataTypeService)
Declaration
string ConvertDbToString(PropertyType propertyType, object value, IDataTypeService dataTypeService)
Parameters
Type | Name | Description |
---|---|---|
PropertyType | propertyType | |
System.Object | value | |
IDataTypeService | dataTypeService |
Returns
Type | Description |
---|---|
System.String |
ConvertDbToXml(Property, IDataTypeService, ILocalizationService, Boolean)
Used for serializing an IContent item for packaging
Declaration
IEnumerable<XElement> ConvertDbToXml(Property property, IDataTypeService dataTypeService, ILocalizationService localizationService, bool published)
Parameters
Type | Name | Description |
---|---|---|
Property | property | |
IDataTypeService | dataTypeService | |
ILocalizationService | localizationService | |
System.Boolean | published |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement> |
ConvertDbToXml(PropertyType, Object, IDataTypeService)
Used for serializing an IContent item for packaging
Declaration
XNode ConvertDbToXml(PropertyType propertyType, object value, IDataTypeService dataTypeService)
Parameters
Type | Name | Description |
---|---|---|
PropertyType | propertyType | |
System.Object | value | |
IDataTypeService | dataTypeService |
Returns
Type | Description |
---|---|
System.Xml.Linq.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 | |
System.Object | currentValue |
Returns
Type | Description |
---|---|
System.Object |
ToEditor(Property, IDataTypeService, String, String)
Converts a property value to a value for the editor.
Declaration
object ToEditor(Property property, IDataTypeService dataTypeService, string culture = null, string segment = null)
Parameters
Type | Name | Description |
---|---|---|
Property | property | |
IDataTypeService | dataTypeService | |
System.String | culture | |
System.String | segment |
Returns
Type | Description |
---|---|
System.Object |
Validate(Object, Boolean, String)
Validates a property value.
Declaration
IEnumerable<ValidationResult> Validate(object value, bool required, string format)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The property value. |
System.Boolean | required | A value indicating whether the property value is required. |
System.String | format | A specific format (regex) that the property value must respect. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> |