/
IntegerConfigurationEditor.cs
38 lines (35 loc) · 1.24 KB
/
IntegerConfigurationEditor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.Validators;
namespace Umbraco.Web.PropertyEditors
{
/// <summary>
/// A custom pre-value editor class to deal with the legacy way that the pre-value data is stored.
/// </summary>
public class IntegerConfigurationEditor : ConfigurationEditor
{
public IntegerConfigurationEditor()
{
Fields.Add(new ConfigurationField(new IntegerValidator())
{
Description = "Enter the minimum amount of number to be entered",
Key = "min",
View = "number",
Name = "Minimum"
});
Fields.Add(new ConfigurationField(new IntegerValidator())
{
Description = "Enter the intervals amount between each step of number to be entered",
Key = "step",
View = "number",
Name = "Step Size"
});
Fields.Add(new ConfigurationField(new IntegerValidator())
{
Description = "Enter the maximum amount of number to be entered",
Key = "max",
View = "number",
Name = "Maximum"
});
}
}
}