api:umfconfig:parser_umfconfigbool
This is an old revision of the document!
Description:
Default bool parser.
Added In: v0.45
Function
public class UMFConfigBool : UMFConfigParser<bool>
{
public bool? DefaultValue;
public bool? VanillaValue;
public bool RequiresRestart;
public UMFConfigBool(bool? defaultValue = null, bool? vanillaValue = null, bool requiresRestart = false)
{
DefaultValue = defaultValue;
VanillaValue = vanillaValue;
RequiresRestart = requiresRestart;
}
public override bool Parse(string value)
{
if (!bool.TryParse(value, out bool result)) result = DefaultValue ?? false;
return result;
}
public override string ToString()
{
return DefaultValue.ToString() ?? null;
}
public override string Default()
{
return DefaultValue.ToString() ?? null;
}
public override string Vanilla()
{
return VanillaValue.ToString() ?? null;
}
public override string Restart()
{
return RequiresRestart.ToString();
}
}
Usage
//Coming soon
Examples
//Coming soon
api/umfconfig/parser_umfconfigbool.1561847505.txt.gz · Last modified: 2019/06/29 22:31 by umfdev
