Class ConfigurationEditor<TConfiguration>
Represents a data type configuration editor with a typed configuration.
Namespace: Umbraco.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()
Initializes a new instance of the ConfigurationEditor<TConfiguration> class.
Declaration
protected ConfigurationEditor()
Properties
View SourceDefaultConfiguration
Gets the default configuration.
Declaration
public override IDictionary<string, object> DefaultConfiguration { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.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).
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 SourceFromConfigurationEditor(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.Collections.Generic.IDictionary<System.String, System.Object> | editorValues | The configuration object posted by the editor. |
TConfiguration | configuration | The current configuration object. |
Returns
Type | Description |
---|---|
TConfiguration |
FromConfigurationEditor(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.Collections.Generic.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 |
FromDatabase(String)
Converts the serialized database value into the actual configuration object.
Declaration
public override object FromDatabase(string configuration)
Parameters
Type | Name | Description |
---|---|---|
System.String | configuration |
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).
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 |
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 |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
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 |
---|---|
System.Collections.Generic.IDictionary<System.String, System.Object> |