|
|
|
@ -1,15 +1,32 @@
|
|
|
|
|
namespace Volo.Abp.Settings
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Volo.Abp.Localization;
|
|
|
|
|
|
|
|
|
|
namespace Volo.Abp.Settings
|
|
|
|
|
{
|
|
|
|
|
public class SettingDefinition
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Unique name of the setting.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[NotNull]
|
|
|
|
|
public string Name { get; }
|
|
|
|
|
|
|
|
|
|
[NotNull]
|
|
|
|
|
public ILocalizableString DisplayName
|
|
|
|
|
{
|
|
|
|
|
get => _displayName;
|
|
|
|
|
set => _displayName = Check.NotNull(value, nameof(value));
|
|
|
|
|
}
|
|
|
|
|
private ILocalizableString _displayName;
|
|
|
|
|
|
|
|
|
|
[CanBeNull]
|
|
|
|
|
public ILocalizableString Description { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Default value of the setting.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[CanBeNull]
|
|
|
|
|
public string DefaultValue { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -26,24 +43,27 @@
|
|
|
|
|
public bool IsInherited { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Can be used to store a custom object related to this setting.
|
|
|
|
|
/// Can be used to get/set custom properties for this setting definition.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public object CustomData { get; set; } //TODO: Convert to dictionary!
|
|
|
|
|
|
|
|
|
|
//TODO: Add Properties dictionary for custom stuff (and remove CustomData)
|
|
|
|
|
[NotNull]
|
|
|
|
|
public Dictionary<string, object> Properties { get; }
|
|
|
|
|
|
|
|
|
|
public SettingDefinition(
|
|
|
|
|
string name,
|
|
|
|
|
string defaultValue = null,
|
|
|
|
|
ILocalizableString displayName = null,
|
|
|
|
|
ILocalizableString description = null,
|
|
|
|
|
bool isVisibleToClients = false,
|
|
|
|
|
bool isInherited = true,
|
|
|
|
|
object customData = null)
|
|
|
|
|
bool isInherited = true)
|
|
|
|
|
{
|
|
|
|
|
Name = name;
|
|
|
|
|
DefaultValue = defaultValue;
|
|
|
|
|
IsVisibleToClients = isVisibleToClients;
|
|
|
|
|
DisplayName = displayName ?? new FixedLocalizableString(name);
|
|
|
|
|
Description = description;
|
|
|
|
|
IsInherited = isInherited;
|
|
|
|
|
CustomData = customData;
|
|
|
|
|
|
|
|
|
|
Properties = new Dictionary<string, object>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|