Files
Umbraco-CMS/src/Umbraco.Infrastructure/PropertyEditors/TrueFalsePropertyEditor.cs
2020-12-04 19:01:52 +01:00

47 lines
1.6 KiB
C#

using Microsoft.Extensions.Logging;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Serialization;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
/// <summary>
/// Represents a checkbox property and parameter editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.Boolean,
EditorType.PropertyValue | EditorType.MacroParameter,
"Toggle",
"boolean",
ValueType = ValueTypes.Integer,
Group = Constants.PropertyEditors.Groups.Common,
Icon = "icon-checkbox")]
public class TrueFalsePropertyEditor : DataEditor
{
private readonly IIOHelper _ioHelper;
/// <summary>
/// Initializes a new instance of the <see cref="TrueFalsePropertyEditor"/> class.
/// </summary>
public TrueFalsePropertyEditor(
ILoggerFactory loggerFactory,
IDataTypeService dataTypeService,
ILocalizationService localizationService,
IIOHelper ioHelper,
IShortStringHelper shortStringHelper,
ILocalizedTextService localizedTextService,
IJsonSerializer jsonSerializer)
: base(loggerFactory, dataTypeService, localizationService, localizedTextService, shortStringHelper, jsonSerializer)
{
_ioHelper = ioHelper;
}
/// <inheritdoc />
protected override IConfigurationEditor CreateConfigurationEditor() => new TrueFalseConfigurationEditor(_ioHelper);
}
}