Class ConfigurationEditor<TConfiguration>
Represents a data type configuration editor with a typed configuration.
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 SourceConfigurationEditor(IIOHelper)
Declaration
protected ConfigurationEditor(IIOHelper ioHelper)
Parameters
Type | Name | Description |
---|---|---|
IIOHelper | ioHelper |
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 | |
IEditor |
editorConfigurationParser |
Properties
View SourceDefaultConfiguration
Gets the default configuration.
Declaration
public override IDictionary<string, object> DefaultConfiguration { get; }
Property Value
Type | Description |
---|---|
IDictionary<System. |
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 To
DefaultConfigurationObject
Gets the default configuration object.
Declaration
public override object DefaultConfigurationObject { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
For basic configuration editors, this will be DefaultTConfiguration
.
Methods
View SourceFromConfigurationEditor(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. |
editorValues | The configuration object posted by the editor. |
TConfiguration | configuration | The current configuration object. |
Returns
Type | Description |
---|---|
TConfiguration |
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. |
editorValues | The values posted by the configuration editor. |
System. |
configuration | The current configuration object. |
Returns
Type | Description |
---|---|
System. |
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. |
configuration | |
IConfiguration |
configurationEditorJsonSerializer |
Returns
Type | Description |
---|---|
System. |
Remarks
Converting the configuration object to the serialized database value is
achieved by simply serializing the configuration. See To
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. |
obj |
Returns
Type | Description |
---|---|
System. |
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. |
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. |
configuration | The configuration. |
Returns
Type | Description |
---|---|
IDictionary<System. |