Search Results for

    Show / Hide Table of Contents
    View Source

    Class ConfigurationEditor<TConfiguration>

    Represents a data type configuration editor with a typed configuration.

    Inheritance
    System.Object
    ConfigurationEditor
    Namespace: Umbraco.Cms.Core.PropertyEditors
    Assembly: Umbraco.Core.dll
    Syntax
    public abstract class ConfigurationEditor<TConfiguration> : ConfigurationEditor, IConfigurationEditor where TConfiguration : new()
    Type Parameters
    Name Description
    TConfiguration

    Constructors

    View Source

    ConfigurationEditor(IIOHelper)

    Declaration
    protected ConfigurationEditor(IIOHelper ioHelper)
    Parameters
    Type Name Description
    IIOHelper ioHelper
    View Source

    ConfigurationEditor(IIOHelper, IEditorConfigurationParser)

    Initializes a new instance of the ConfigurationEditor<TConfiguration> class.

    Declaration
    protected ConfigurationEditor(IIOHelper ioHelper, IEditorConfigurationParser editorConfigurationParser)
    Parameters
    Type Name Description
    IIOHelper ioHelper
    IEditorConfigurationParser editorConfigurationParser

    Properties

    View Source

    DefaultConfiguration

    Gets the default configuration.

    Declaration
    public override IDictionary<string, object> DefaultConfiguration { get; }
    Property Value
    Type Description
    IDictionary<System.String, System.Object>
    Remarks

    For basic configuration editors, this will be a dictionary of key/values. For advanced editors which inherit from ConfigurationEditor<TConfiguration>, this will be the dictionary equivalent of an actual configuration object (ie an instance of TConfiguration, obtained via ToConfigurationEditor(Object).

    View Source

    DefaultConfigurationObject

    Gets the default configuration object.

    Declaration
    public override object DefaultConfigurationObject { get; }
    Property Value
    Type Description
    System.Object
    Remarks

    For basic configuration editors, this will be DefaultConfiguration, ie a dictionary of key/values. For advanced editors which inherit from ConfigurationEditor<TConfiguration>, this will be an actual configuration object (ie an instance of TConfiguration.

    Methods

    View Source

    FromConfigurationEditor(Nullable<IDictionary<String, Object>>, TConfiguration)

    Converts the configuration posted by the editor.

    Declaration
    public virtual TConfiguration FromConfigurationEditor(IDictionary<string, object>? editorValues, TConfiguration configuration)
    Parameters
    Type Name Description
    System.Nullable<IDictionary<System.String, System.Object>> editorValues

    The configuration object posted by the editor.

    TConfiguration configuration

    The current configuration object.

    Returns
    Type Description
    TConfiguration
    View Source

    FromConfigurationEditor(Nullable<IDictionary<String, Object>>, Object)

    Converts the values posted by the configuration editor into the actual configuration object.

    Declaration
    public sealed override object FromConfigurationEditor(IDictionary<string, object>? editorValues, object configuration)
    Parameters
    Type Name Description
    System.Nullable<IDictionary<System.String, System.Object>> editorValues

    The values posted by the configuration editor.

    System.Object configuration

    The current configuration object.

    Returns
    Type Description
    System.Object
    View Source

    FromDatabase(String, IConfigurationEditorJsonSerializer)

    Converts the serialized database value into the actual configuration object.

    Declaration
    public override object FromDatabase(string configuration, IConfigurationEditorJsonSerializer configurationEditorJsonSerializer)
    Parameters
    Type Name Description
    System.String configuration
    IConfigurationEditorJsonSerializer configurationEditorJsonSerializer
    Returns
    Type Description
    System.Object
    Remarks

    Converting the configuration object to the serialized database value is achieved by simply serializing the configuration. See ToDatabase(Object, IConfigurationEditorJsonSerializer).

    View Source

    IsConfiguration(Object)

    Determines whether a configuration object is of the type expected by the configuration editor.

    Declaration
    public override bool IsConfiguration(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    View Source

    ToConfigurationEditor(TConfiguration)

    Converts configuration values to values for the editor.

    Declaration
    public virtual Dictionary<string, object> ToConfigurationEditor(TConfiguration configuration)
    Parameters
    Type Name Description
    TConfiguration configuration

    The configuration.

    Returns
    Type Description
    Umbraco.Cms.Core.Dictionary<System.String, System.Object>
    View Source

    ToConfigurationEditor(Object)

    Converts the configuration object to values for the configuration editor.

    Declaration
    public sealed override IDictionary<string, object> ToConfigurationEditor(object configuration)
    Parameters
    Type Name Description
    System.Object configuration

    The configuration.

    Returns
    Type Description
    IDictionary<System.String, System.Object>
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • ConfigurationEditor(IIOHelper)
      • ConfigurationEditor(IIOHelper, IEditorConfigurationParser)
    • Properties
      • DefaultConfiguration
      • DefaultConfigurationObject
    • Methods
      • FromConfigurationEditor(Nullable<IDictionary<String, Object>>, TConfiguration)
      • FromConfigurationEditor(Nullable<IDictionary<String, Object>>, Object)
      • FromDatabase(String, IConfigurationEditorJsonSerializer)
      • IsConfiguration(Object)
      • ToConfigurationEditor(TConfiguration)
      • ToConfigurationEditor(Object)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX