Class TextOnlyValueEditor
Custom value editor which ensures that the value stored is just plain text and that no magic json formatting occurs when translating it to and from the database values
Namespace: Umbraco.Cms.Core.PropertyEditors
Assembly: Umbraco.Core.dll
Syntax
public class TextOnlyValueEditor : DataValueEditor, IDataValueEditor
Constructors
View SourceTextOnlyValueEditor(DataEditorAttribute, ILocalizedTextService, IShortStringHelper, IJsonSerializer, IIOHelper)
Declaration
public TextOnlyValueEditor(DataEditorAttribute attribute, ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IJsonSerializer jsonSerializer, IIOHelper ioHelper)
Parameters
Type | Name | Description |
---|---|---|
DataEditorAttribute | attribute | |
ILocalizedTextService | localizedTextService | |
IShortStringHelper | shortStringHelper | |
IJsonSerializer | jsonSerializer | |
IIOHelper | ioHelper |
Methods
View SourceToEditor(IProperty, String, String)
A method used to format the database value to a value that can be used by the editor
Declaration
public override object ToEditor(IProperty property, string culture = null, string segment = null)
Parameters
Type | Name | Description |
---|---|---|
IProperty | property | |
System.String | culture | |
System.String | segment |
Returns
Type | Description |
---|---|
System.Object |
Remarks
The object returned will always be a string and if the database type is not a valid string type an exception is thrown