Class MultiNodeTreePickerPropertyEditor.MultiNodeTreePickerPropertyValueEditor
Defines the value editor for the media picker property editor.
Namespace: Umbraco.Cms.Core.PropertyEditors
Assembly: Umbraco.Infrastructure.dll
Syntax
public class MultiNodeTreePickerPropertyValueEditor : DataValueEditor, IDataValueEditor, IDataValueReference
Remarks
At first glance, the FromEditor and ToEditor methods might seem strange. This is because we wanted to stop the leaking of UDIs to the frontend while not having to do database migrations so we opted to, for now, translate the UDI string in the database into a structured format unique to the client. This way, for now, no migration is needed and no changes outside of the editor logic needs to be touched to stop the leaking.
Constructors
View SourceMultiNodeTreePickerPropertyValueEditor(IShortStringHelper, IJsonSerializer, IIOHelper, DataEditorAttribute)
Initializes a new instance of the Multi
Declaration
public MultiNodeTreePickerPropertyValueEditor(IShortStringHelper shortStringHelper, IJsonSerializer jsonSerializer, IIOHelper ioHelper, DataEditorAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
IShort |
shortStringHelper | |
IJson |
jsonSerializer | |
IIOHelper | ioHelper | |
Data |
attribute |
MultiNodeTreePickerPropertyValueEditor(IShortStringHelper, IJsonSerializer, IIOHelper, DataEditorAttribute, ILocalizedTextService, IEntityService, ICoreScopeProvider, IContentService, IMediaService, IMemberService)
Initializes a new instance of the Multi
Declaration
public MultiNodeTreePickerPropertyValueEditor(IShortStringHelper shortStringHelper, IJsonSerializer jsonSerializer, IIOHelper ioHelper, DataEditorAttribute attribute, ILocalizedTextService localizedTextService, IEntityService entityService, ICoreScopeProvider coreScopeProvider, IContentService contentService, IMediaService mediaService, IMemberService memberService)
Parameters
Type | Name | Description |
---|---|---|
IShort |
shortStringHelper | |
IJson |
jsonSerializer | |
IIOHelper | ioHelper | |
Data |
attribute | |
ILocalized |
localizedTextService | |
IEntity |
entityService | |
ICore |
coreScopeProvider | |
IContent |
contentService | |
IMedia |
mediaService | |
IMember |
memberService |
Methods
View SourceFromEditor(ContentPropertyData, Object)
A method to deserialize the string value that has been saved in the content editor to an object to be stored in the database.
Declaration
public override object FromEditor(ContentPropertyData editorValue, object currentValue)
Parameters
Type | Name | Description |
---|---|---|
Content |
editorValue | The value returned by the editor. |
System. |
currentValue | The current value that has been persisted to the database for this editor. This value may be useful for how the value then get's deserialized again to be re-persisted. In most cases it will probably not be used. |
Returns
Type | Description |
---|---|
System. |
The value that gets persisted to the database. |
Remarks
By default this will attempt to automatically convert the string value to the value type supplied by ValueType. If overridden then the object returned must match the type supplied in the ValueType, otherwise persisting the value to the DB will fail when it tries to validate the value type.
GetReferences(Object)
Declaration
public IEnumerable<UmbracoEntityReference> GetReferences(object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
value |
Returns
Type | Description |
---|---|
IEnumerable<Umbraco |
ToEditor(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 | The property. |
System. |
culture | The culture. |
System. |
segment | The segment. |
Returns
Type | Description |
---|---|
System. |
Remarks
The object returned will automatically be serialized into JSON notation. For most property editors the value returned is probably just a string, but in some cases a JSON structure will be returned.
Exceptions
Type | Condition |
---|---|
System. |
ValueType was out of range. |