Search Results for

    Show / Hide Table of Contents
    View Source

    Class DataEditor

    Represents a data editor.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.PropertyEditors
    Assembly: Umbraco.Core.dll
    Syntax
    [DataContract]
    public class DataEditor : IDataEditor, IDiscoverable
    Remarks

    Editors can be deserialized from e.g. manifests, which is. why the class is not abstract, the json serialization attributes are required, and the properties have an internal setter.

    Constructors

    View Source

    DataEditor(IDataValueEditorFactory, EditorType)

    Initializes a new instance of the DataEditor class.

    Declaration
    public DataEditor(IDataValueEditorFactory dataValueEditorFactory, EditorType type = EditorType.PropertyValue)
    Parameters
    Type Name Description
    IDataValueEditorFactory dataValueEditorFactory
    EditorType type

    Properties

    View Source

    Alias

    Gets the alias of the editor.

    Declaration
    [DataMember(Name = "alias", IsRequired = true)]
    public string Alias { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    Attribute

    Gets the editor attribute.

    Declaration
    protected DataEditorAttribute Attribute { get; }
    Property Value
    Type Description
    DataEditorAttribute
    View Source

    DataValueEditorFactory

    Declaration
    protected IDataValueEditorFactory DataValueEditorFactory { get; }
    Property Value
    Type Description
    IDataValueEditorFactory
    View Source

    DefaultConfiguration

    Declaration
    [DataMember(Name = "defaultConfig")]
    public IDictionary<string, object> DefaultConfiguration { get; set; }
    Property Value
    Type Description
    IDictionary<System.String, System.Object>
    View Source

    ExplicitConfigurationEditor

    Gets or sets an explicit configuration editor.

    Declaration
    [DataMember(Name = "config")]
    public IConfigurationEditor ExplicitConfigurationEditor { get; set; }
    Property Value
    Type Description
    IConfigurationEditor
    Remarks

    Used for manifest data editors.

    View Source

    ExplicitValueEditor

    Gets or sets an explicit value editor.

    Declaration
    [DataMember(Name = "editor")]
    public IDataValueEditor ExplicitValueEditor { get; set; }
    Property Value
    Type Description
    IDataValueEditor
    Remarks

    Used for manifest data editors.

    View Source

    Group

    Gets the group of the editor.

    Declaration
    [DataMember(Name = "group")]
    public string Group { get; }
    Property Value
    Type Description
    System.String
    Remarks

    Can be used to organize editors when presenting them.

    View Source

    Icon

    Gets the icon of the editor.

    Declaration
    [DataMember(Name = "icon")]
    public string Icon { get; }
    Property Value
    Type Description
    System.String
    Remarks

    Can be used to display editors when presenting them.

    View Source

    IsDeprecated

    Gets a value indicating whether the editor is deprecated.

    Declaration
    [IgnoreDataMember]
    public bool IsDeprecated { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    Deprecated editors are supported but not proposed in the UI.

    View Source

    Name

    Gets the name of the editor.

    Declaration
    [DataMember(Name = "name", IsRequired = true)]
    public string Name { get; }
    Property Value
    Type Description
    System.String
    View Source

    PropertyIndexValueFactory

    Gets the index value factory for the editor.

    Declaration
    public virtual IPropertyIndexValueFactory PropertyIndexValueFactory { get; }
    Property Value
    Type Description
    IPropertyIndexValueFactory
    View Source

    SupportsReadOnly

    Declaration
    [DataMember(Name = "supportsReadOnly", IsRequired = true)]
    public bool SupportsReadOnly { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    Type

    Gets the type of the editor.

    Declaration
    [IgnoreDataMember]
    public EditorType Type { get; }
    Property Value
    Type Description
    EditorType
    Remarks

    An editor can be a property value editor, or a parameter editor.

    Methods

    View Source

    CreateConfigurationEditor()

    Creates a configuration editor instance.

    Declaration
    protected virtual IConfigurationEditor CreateConfigurationEditor()
    Returns
    Type Description
    IConfigurationEditor
    View Source

    CreateValueEditor()

    Creates a value editor instance.

    Declaration
    protected virtual IDataValueEditor CreateValueEditor()
    Returns
    Type Description
    IDataValueEditor
    View Source

    DebuggerDisplay()

    Provides a summary of the PropertyEditor for use with the System.Diagnostics.DebuggerDisplayAttribute.

    Declaration
    protected virtual string DebuggerDisplay()
    Returns
    Type Description
    System.String
    View Source

    GetConfigurationEditor()

    Gets an editor to edit the value editor configuration.

    Declaration
    public IConfigurationEditor GetConfigurationEditor()
    Returns
    Type Description
    IConfigurationEditor
    Remarks

    If an explicit configuration editor has been assigned, then this explicit instance is returned. Otherwise, a new instance is created by CreateConfigurationEditor.

    The instance created by CreateConfigurationEditor is not cached, i.e. a new instance is created each time. The property editor is a singleton, and although the configuration editor could technically be a singleton too, we'd rather not keep configuration editor cached.

    View Source

    GetValueEditor()

    Gets a value editor.

    Declaration
    public IDataValueEditor GetValueEditor()
    Returns
    Type Description
    IDataValueEditor
    Remarks

    If an explicit value editor has been assigned, then this explicit instance is returned. Otherwise, a new instance is created by CreateValueEditor.

    The instance created by CreateValueEditor is cached if allowed by the DataEditor attribute (ValueEditorIsReusable == true).

    View Source

    GetValueEditor(Object)

    Gets a configured value editor.

    Declaration
    public virtual IDataValueEditor GetValueEditor(object configuration)
    Parameters
    Type Name Description
    System.Object configuration
    Returns
    Type Description
    IDataValueEditor
    Remarks

    If an explicit value editor has been assigned, then this explicit instance is returned. Otherwise, a new instance is created by CreateValueEditor, and configured with the configuration.

    The instance created by CreateValueEditor is not cached, i.e. a new instance is created each time the property value is retrieved. The property editor is a singleton, and the value editor cannot be a singleton since it depends on the datatype configuration.

    Technically, it could be cached by datatype but let's keep things simple enough for now.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • DataEditor(IDataValueEditorFactory, EditorType)
    • Properties
      • Alias
      • Attribute
      • DataValueEditorFactory
      • DefaultConfiguration
      • ExplicitConfigurationEditor
      • ExplicitValueEditor
      • Group
      • Icon
      • IsDeprecated
      • Name
      • PropertyIndexValueFactory
      • SupportsReadOnly
      • Type
    • Methods
      • CreateConfigurationEditor()
      • CreateValueEditor()
      • DebuggerDisplay()
      • GetConfigurationEditor()
      • GetValueEditor()
      • GetValueEditor(Object)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX