Class AppSetting<TValue>
Defined lazy initialized setting
public class AppSetting<TValue> : CMSLazy<TValue>
Type Parameters
TValue
- Inheritance
-
objectCMSLazy<TValue>AppSetting<TValue>
- Derived
- Inherited Members
- Extension Methods
Constructors
AppSetting(string, TValue, Func<object, TValue, TValue>)
Constructor
public AppSetting(string keyName, TValue defaultValue, Func<object, TValue, TValue> converter)
Parameters
keyName
stringSettings key name
defaultValue
TValueDefault value
converter
Func<object, TValue, TValue>Conversion function
Properties
Converter
Conversion function
protected Func<object, TValue, TValue> Converter { get; set; }
Property Value
- Func<object, TValue, TValue>
DefaultValueInitializer
Function to retrieve the default value
public Func<TValue> DefaultValueInitializer { get; set; }
Property Value
- Func<TValue>
KeyName
Settings key name
public string KeyName { get; protected set; }
Property Value
- string
MasterKeyName
Defines the master key name which is used in case the key name value is not found
public string MasterKeyName { get; set; }
Property Value
- string
Methods
ConvertValue(object, TValue)
Converts the value to the correct type
protected virtual TValue ConvertValue(object value, TValue defaultValue)
Parameters
value
objectValue to convert
defaultValue
TValueDefault value
Returns
- TValue
NewValue()
Initializes a new value
protected override TValue NewValue()
Returns
- TValue
ToString()
Returns value converted to string.
public override string ToString()
Returns
- string