[This is preliminary documentation and is subject to change.]
The Config type exposes the following methods.
Methods
| Member | Description | |
|---|---|---|
| Enabled | Attempts to parse given key's value as a boolean.
Throws a FormatException on failure. | |
| GetDefault | Provides the default value for a given ConfigKey. | |
| GetDescription | Returns the description text for a given config key. | |
| GetEnum``1 | Attempts to parse a given key's value as an enumeration.
An ArgumentException is thrown if value could not be parsed.
Note the parsing is done in a case-insensitive way. | |
| GetInt | Attempts to parse given key's value as an integer.
Throws a FormatException on failure. | |
| GetKeys | Returns a list of all keys in a section. | |
| GetMetadata | Returns the metadata container (ConfigKeyAttribute object) for a given key. | |
| GetSection | Returns the ConfigSection that a given key is associated with. | |
| GetString | Returns raw value for the given key. | |
| GetValueType | Returns the expected Type of the key's value, as specified in key metadata. | |
| IsBlank | Checks whether any value has been set for a given key. | |
| IsDefault | Checks whether given ConfigKey still has its default value. | |
| Load(Boolean, Boolean) | Loads configuration from file. | |
| LoadDefaults()()()() | Overwrites current settings with defaults. | |
| LoadDefaults(ConfigSection) | Loads defaults for keys in a given ConfigSection. | |
| ResetLogOptions()()()() | ||
| ResetRanks()()()() | Resets the list of ranks to defaults (guest/builder/op/owner).
Warning: This method is not thread-safe, and should never be used on a live server. | |
| ResetValue | Resets key value to its default setting. | |
| Save()()()() | ||
| SetValue | Sets value of a given config key.
Note that this method may throw exceptions if the given value is not acceptable.
Use Config.TrySetValue() if you'd like to suppress exceptions in favor of a boolean return value. | |
| TryGetBool | Attempts to parse a given key's value as a boolean. | |
| TryGetInt | Attempts to parse a given key's value as an integer. | |
| TrySetValue | Attempts to set the value of a given config key.
Check the return value to make sure that the given value was acceptable. |