using System.Collections.Generic; using Umbraco.Core; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { /// /// Represents the configuration for the label value editor. /// public class LabelConfigurationEditor : ConfigurationEditor { /// public override LabelConfiguration FromConfigurationEditor(IDictionary editorValues, LabelConfiguration configuration) { var newConfiguration = new LabelConfiguration(); // get the value type // not simply deserializing Json because we want to validate the valueType if (editorValues.TryGetValue(Constants.PropertyEditors.ConfigurationKeys.DataValueType, out var valueTypeObj) && valueTypeObj is string stringValue) { if (!string.IsNullOrWhiteSpace(stringValue) && ValueTypes.IsValue(stringValue)) // validate newConfiguration.ValueType = stringValue; } return newConfiguration; } } }