Search Results for

    Show / Hide Table of Contents
    View Source

    Class MultiNodeTreePickerPropertyEditor.MultiNodeTreePickerPropertyValueEditor

    Defines the value editor for the media picker property editor.

    Inheritance
    System.Object
    DataValueEditor
    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 Source

    MultiNodeTreePickerPropertyValueEditor(IShortStringHelper, IJsonSerializer, IIOHelper, DataEditorAttribute)

    Initializes a new instance of the MultiNodeTreePickerPropertyEditor.MultiNodeTreePickerPropertyValueEditor class.

    Declaration
    public MultiNodeTreePickerPropertyValueEditor(IShortStringHelper shortStringHelper, IJsonSerializer jsonSerializer, IIOHelper ioHelper, DataEditorAttribute attribute)
    Parameters
    Type Name Description
    IShortStringHelper shortStringHelper
    IJsonSerializer jsonSerializer
    IIOHelper ioHelper
    DataEditorAttribute attribute
    View Source

    MultiNodeTreePickerPropertyValueEditor(IShortStringHelper, IJsonSerializer, IIOHelper, DataEditorAttribute, ILocalizedTextService, IEntityService, ICoreScopeProvider, IContentService, IMediaService, IMemberService)

    Initializes a new instance of the MultiNodeTreePickerPropertyEditor.MultiNodeTreePickerPropertyValueEditor class.

    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
    IShortStringHelper shortStringHelper
    IJsonSerializer jsonSerializer
    IIOHelper ioHelper
    DataEditorAttribute attribute
    ILocalizedTextService localizedTextService
    IEntityService entityService
    ICoreScopeProvider coreScopeProvider
    IContentService contentService
    IMediaService mediaService
    IMemberService memberService

    Methods

    View Source

    FromEditor(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
    ContentPropertyData editorValue

    The value returned by the editor.

    System.Object 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.Object

    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.

    View Source

    GetReferences(Object)

    Declaration
    public IEnumerable<UmbracoEntityReference> GetReferences(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    IEnumerable<UmbracoEntityReference>
    View Source

    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.String culture

    The culture.

    System.String segment

    The segment.

    Returns
    Type Description
    System.Object
    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.ArgumentOutOfRangeException

    ValueType was out of range.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • MultiNodeTreePickerPropertyValueEditor(IShortStringHelper, IJsonSerializer, IIOHelper, DataEditorAttribute)
      • MultiNodeTreePickerPropertyValueEditor(IShortStringHelper, IJsonSerializer, IIOHelper, DataEditorAttribute, ILocalizedTextService, IEntityService, ICoreScopeProvider, IContentService, IMediaService, IMemberService)
    • Methods
      • FromEditor(ContentPropertyData, Object)
      • GetReferences(Object)
      • ToEditor(IProperty, String, String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX